summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/cluster
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-02-01 21:25:43 +0000
committerAlan Conway <aconway@apache.org>2011-02-01 21:25:43 +0000
commit7b287e266b4478b14208cfe3d60a8cb078102324 (patch)
tree8d3aa1e6cd50da68d22632f9823a5b11be9c2e4c /qpid/cpp/src/qpid/cluster
parent080be271bc487183d676afec0c1dc7cc9c71ee2b (diff)
downloadqpid-python-7b287e266b4478b14208cfe3d60a8cb078102324.tar.gz
QPID-3007: Don't hold on to consumer shared-pointers in UpdateClient::consumerNumbering
Holding shared pointers in UpdateClient::consumerNumbering can hold consumers in memory and delete them out of sync with other cluster members. Made it hold plain pointers instead since we don't actually need to ensure object liveness, we're just doing an address/number correspondence. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1066217 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/cluster')
-rw-r--r--qpid/cpp/src/qpid/cluster/UpdateClient.cpp7
-rw-r--r--qpid/cpp/src/qpid/cluster/UpdateClient.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/cluster/UpdateClient.cpp b/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
index e5d20c85e6..4f6488a28a 100644
--- a/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
+++ b/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
@@ -497,7 +497,7 @@ void UpdateClient::updateConsumer(
ci->isNotifyEnabled(),
ci->position
);
- consumerNumbering.add(ci);
+ consumerNumbering.add(ci.get());
QPID_LOG(debug, *this << " updated consumer " << ci->getName()
<< " on " << shadowSession.getId());
@@ -584,10 +584,9 @@ void UpdateClient::updateQueueListeners(const boost::shared_ptr<broker::Queue>&
}
void UpdateClient::updateQueueListener(std::string& q,
- const boost::shared_ptr<broker::Consumer>& c)
+ const boost::shared_ptr<broker::Consumer>& c)
{
- const boost::shared_ptr<SemanticState::ConsumerImpl> ci =
- boost::dynamic_pointer_cast<SemanticState::ConsumerImpl>(c);
+ SemanticState::ConsumerImpl* ci = dynamic_cast<SemanticState::ConsumerImpl*>(c.get());
size_t n = consumerNumbering[ci];
if (n >= consumerNumbering.size())
throw Exception(QPID_MSG("Unexpected listener on queue " << q));
diff --git a/qpid/cpp/src/qpid/cluster/UpdateClient.h b/qpid/cpp/src/qpid/cluster/UpdateClient.h
index 156fa112df..7520bb82cb 100644
--- a/qpid/cpp/src/qpid/cluster/UpdateClient.h
+++ b/qpid/cpp/src/qpid/cluster/UpdateClient.h
@@ -106,7 +106,7 @@ class UpdateClient : public sys::Runnable {
void updateBridge(const boost::shared_ptr<broker::Bridge>&);
- Numbering<broker::SemanticState::ConsumerImpl::shared_ptr> consumerNumbering;
+ Numbering<broker::SemanticState::ConsumerImpl*> consumerNumbering;
MemberId updaterId;
MemberId updateeId;
Url updateeUrl;