From 6b9decf55d9aa235bfbcca645501165d08b61749 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 30 Jun 2009 20:51:38 +0000 Subject: Fix cluster race condition with connections closed by broker while in use. If a client is using a connection that is closed at the broker end because of an error, there is a race condition that allows the connection to be incorrectly re-created on replica brokers which can cause those brokers to exit with an error that does not occur on the directly connected broker. The fix: explicitly announce new connections, shadow connections are no longer implicitly created on first use. Make error-check a cluster control so it can be handled independently of the lifecycle of the connection where an error initially occured. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@789947 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/qpid_ping.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/src/tests/qpid_ping.cpp') diff --git a/qpid/cpp/src/tests/qpid_ping.cpp b/qpid/cpp/src/tests/qpid_ping.cpp index e4cbe75b57..ddd70515be 100644 --- a/qpid/cpp/src/tests/qpid_ping.cpp +++ b/qpid/cpp/src/tests/qpid_ping.cpp @@ -94,6 +94,7 @@ class Ping : public Runnable { ; if (status == WAITING && !opts.quiet) cerr << "Timed out after " << opts.timeout << " seconds." << endl; + if (status != WAITING) thread.join(); return status == SUCCESS; } }; @@ -104,7 +105,7 @@ int main(int argc, char** argv) { opts.parse(argc, argv); Ping ping; ping.start(); - if (!ping.wait()) return 1; + if (!ping.wait()) exit(1); if (!opts.quiet) cout << "Success!" << endl; return 0; } catch (const exception& e) { -- cgit v1.2.1