From e36a24bb215c62ff79f2361fd5d544a7f3ef050e Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 1 Dec 2010 21:32:43 +0000 Subject: Enable cluster-safe assertions on transition to CATCHUP Delaying until READY was causing multiple clientConnect management events to be raised, because broker::Connection::setUserId relies on sys::isCluster to avoid producing duplicate events with cluster::Connection::announce git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1041179 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Cluster.cpp | 6 ++++-- cpp/src/tests/cluster_tests.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'cpp') diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index acf4206629..b7545ad706 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -913,6 +913,7 @@ bool Cluster::isExpectingUpdate() { return state <= UPDATEE; } +// Called in update thread or deliver thread. void Cluster::checkUpdateIn(Lock& l) { if (state != UPDATEE) return; // Wait till we reach the stall point. if (!updateClosed) return; // Wait till update connection closes. @@ -926,10 +927,11 @@ void Cluster::checkUpdateIn(Lock& l) { // thread. It will be updated on delivery of the "ready" we just mcast. broker.setClusterUpdatee(false); if (mAgent) mAgent->suppress(false); // Enable management output. - discarding = false; // ok to set, we're stalled for update. + discarding = false; // OK to set, we're stalled for update. QPID_LOG(notice, *this << " update complete, starting catch-up."); - QPID_LOG(debug, debugSnapshot()); + QPID_LOG(debug, debugSnapshot()); // OK to call because we're stalled. if (mAgent) mAgent->clusterUpdate(); + enableClusterSafe(); // Enable cluster-safe assertions deliverEventQueue.start(); } else if (updateRetracted) { // Update was retracted, request another update diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py index 516595b9e7..9f70121b74 100755 --- a/cpp/src/tests/cluster_tests.py +++ b/cpp/src/tests/cluster_tests.py @@ -293,7 +293,7 @@ class LongTests(BrokerTest): i += 1 b = cluster.start(expect=EXPECT_EXIT_FAIL) ErrorGenerator(b) - time.sleep(min(5,self.duration()/2)) + time.sleep(5) sender.stop() receiver.stop() for i in range(i, len(cluster)): cluster[i].kill() @@ -382,7 +382,7 @@ class LongTests(BrokerTest): start_mclients(cluster[alive]) while time.time() < endtime: - time.sleep(max(5,self.duration()/4)) + time.sleep(5) for b in cluster[alive:]: b.ready() # Check if a broker crashed. # Kill the first broker, expect the clients to fail. b = cluster[alive] -- cgit v1.2.1