summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 082e5488e8..37562ce46c 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -238,8 +238,13 @@ void Cluster::addShadowConnection(const boost::intrusive_ptr<Connection>& c) {
connections.insert(ConnectionMap::value_type(c->getId(), c));
}
-// Called by Connection::deliverClose() in deliverFrameQueue thread.
void Cluster::erase(const ConnectionId& id) {
+ Lock l(lock);
+ erase(id,l);
+}
+
+// Called by Connection::deliverClose() in deliverFrameQueue thread.
+void Cluster::erase(const ConnectionId& id, Lock&) {
connections.erase(id);
decoder.erase(id);
}
@@ -702,8 +707,10 @@ void Cluster::memberUpdate(Lock& l) {
while (i != connections.end()) {
ConnectionMap::iterator j = i++;
MemberId m = j->second->getId().getMember();
- if (m != self && !map.isMember(m))
- j->second->deliverClose();
+ if (m != self && !map.isMember(m)) {
+ j->second->getBrokerConnection().closed();
+ erase(j->second->getId(), l);
+ }
}
}