diff options
author | Alan Conway <aconway@apache.org> | 2011-02-08 20:28:16 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2011-02-08 20:28:16 +0000 |
commit | c2619b8aaf8fa95d08a58d2e6567070815b82f55 (patch) | |
tree | df6d3accb5f84ac3f7d249e87cec36fc4a2a6284 /cpp/src/qpid/broker/SessionState.cpp | |
parent | 706ef87511a99b1fe6f37e1b51fb152ec34c315e (diff) | |
download | qpid-python-c2619b8aaf8fa95d08a58d2e6567070815b82f55.tar.gz |
QPID-3045 - sporadic failure of cluster_tests.ShortTests.test_route_update
Sporadically the test was failing because the session associated with
an inter-broker bridge was created out of order with other
objects. This is unlikely to cause a fatal cluster inconsistency in
practice but it has been corrected in any case. The fix was to delay
creation of the management object for a bridge session till a point
which is consistent on all cluster members.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1068554 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SessionState.cpp')
-rw-r--r-- | cpp/src/qpid/broker/SessionState.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp index 6f02399795..1ca7b6dfc1 100644 --- a/cpp/src/qpid/broker/SessionState.cpp +++ b/cpp/src/qpid/broker/SessionState.cpp @@ -53,7 +53,8 @@ using qpid::sys::AbsTime; namespace _qmf = qmf::org::apache::qpid::broker; SessionState::SessionState( - Broker& b, SessionHandler& h, const SessionId& id, const SessionState::Configuration& config) + Broker& b, SessionHandler& h, const SessionId& id, + const SessionState::Configuration& config, bool delayManagement) : qpid::SessionState(id, config), broker(b), handler(&h), semanticState(*this, *this), @@ -71,6 +72,12 @@ SessionState::SessionState( QPID_LOG(warning, getId() << ": Unable to flow control client - client doesn't support"); } } + if (!delayManagement) addManagementObject(); + attach(h); +} + +void SessionState::addManagementObject() { + if (GetManagementObject()) return; // Already added. Manageable* parent = broker.GetVhostObject (); if (parent != 0) { ManagementAgent* agent = getBroker().getManagementAgent(); @@ -80,11 +87,11 @@ SessionState::SessionState( mgmtObject->set_attached (0); mgmtObject->set_detachedLifespan (0); mgmtObject->clr_expireTime(); - if (rateFlowcontrol) mgmtObject->set_maxClientRate(maxRate); + if (rateFlowcontrol) + mgmtObject->set_maxClientRate(rateFlowcontrol->getRate()); agent->addObject(mgmtObject); } } - attach(h); } SessionState::~SessionState() { |