From f7bfdb626b1938431a976bfabebf1a3fd17cd1a8 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 15 May 2013 15:03:44 +0000 Subject: QPID-4745: HA safe port allocation for brokers in HA tests. Many HA tests use --port=0 to start a broker on an available port, but then need to shutdown and restart the broker on the same port. This is not safe, on a busy system it is possible for another process to take the port between the time the broker is shut down and the time it is restarted. The solution is to do bind(0) and listen in the python test framework (class HaPort) and let the broker use the socket using qpidd --socket-fd. When the broker is shut down the port remains bound by the python process. When the broker is re-started it again is given access to the socket via --socket-fd. Other changes - move ha_store_tests into ha_tests. - add heartbeats to avoid stalling. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1482881 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/ha/StatusCheck.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cpp/src/qpid/ha/StatusCheck.cpp') diff --git a/cpp/src/qpid/ha/StatusCheck.cpp b/cpp/src/qpid/ha/StatusCheck.cpp index 6f92bec19e..f6371d018a 100644 --- a/cpp/src/qpid/ha/StatusCheck.cpp +++ b/cpp/src/qpid/ha/StatusCheck.cpp @@ -103,6 +103,10 @@ void StatusCheckThread::run() { catch(const exception& e) { QPID_LOG(warning, statusCheck.logPrefix << "Error closing status check connection to " << url); } + try { c.close(); } + catch(const exception& e) { + QPID_LOG(warning, "Error closing status check connection to " << url); + } delete this; } -- cgit v1.2.1