qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1441162 - /qpid/trunk/qpid/cpp/src/qpid/ha/Membership.cpp
Date Thu, 31 Jan 2013 19:43:34 GMT
Author: aconway
Date: Thu Jan 31 19:43:33 2013
New Revision: 1441162

URL: http://svn.apache.org/viewvc?rev=1441162&view=rev
Log:
QPID-4555: HA fix deletion of self from membership.

It was possible for a membership update to erase a broker it's own membership.
This caused infrequent core dumps while running ha_tests.test_failover_send_receive.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/ha/Membership.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/Membership.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/Membership.cpp?rev=1441162&r1=1441161&r2=1441162&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/Membership.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/Membership.cpp Thu Jan 31 19:43:33 2013
@@ -59,6 +59,7 @@ void Membership::add(const BrokerInfo& b
 
 void Membership::remove(const types::Uuid& id) {
     Mutex::ScopedLock l(lock);
+    if (id == self) return;     // Never remove myself
     BrokerInfo::Map::iterator i = brokers.find(id);
     if (i != brokers.end()) {
         brokers.erase(i);
@@ -73,7 +74,7 @@ bool Membership::contains(const types::U
 
 void Membership::assign(const types::Variant::List& list) {
     Mutex::ScopedLock l(lock);
-    brokers.clear();
+    clear();
     for (types::Variant::List::const_iterator i = list.begin(); i != list.end(); ++i) {
         BrokerInfo b(i->asMap());
         brokers[b.getSystemId()] = b;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message