You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2011/02/01 22:25:43 UTC

svn commit: r1066217 - in /qpid/trunk/qpid/cpp/src/qpid/cluster: UpdateClient.cpp UpdateClient.h

Author: aconway
Date: Tue Feb  1 21:25:43 2011
New Revision: 1066217

URL: http://svn.apache.org/viewvc?rev=1066217&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.h

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp?rev=1066217&r1=1066216&r2=1066217&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp Tue Feb  1 21:25:43 2011
@@ -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(
 }
 
 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));

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.h?rev=1066217&r1=1066216&r2=1066217&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.h Tue Feb  1 21:25:43 2011
@@ -106,7 +106,7 @@ class UpdateClient : public sys::Runnabl
     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;



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org