Author: aconway
Date: Wed Dec 1 21:32:43 2010
New Revision: 1041179
URL: http://svn.apache.org/viewvc?rev=1041179&view=rev
Log:
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
Modified:
qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
qpid/trunk/qpid/cpp/src/tests/cluster_tests.py
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=1041179&r1=1041178&r2=1041179&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Wed Dec 1 21:32:43 2010
@@ -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
Modified: qpid/trunk/qpid/cpp/src/tests/cluster_tests.py
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/cluster_tests.py?rev=1041179&r1=1041178&r2=1041179&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/cluster_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/cluster_tests.py Wed Dec 1 21:32:43 2010
@@ -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]
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]