Author: aconway
Date: Fri Jan  6 21:54:58 2012
New Revision: 1228425

URL: http://svn.apache.org/viewvc?rev=1228425&view=rev
Log:
QPID-3603: Fix memory management error in QueueReplicator.cpp

Modified:
    qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/QueueReplicator.cpp
    qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp
    qpid/branches/qpid-3603/qpid/cpp/src/tests/qpid-cpp-benchmark

Modified: qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/QueueReplicator.cpp
URL: 
http://svn.apache.org/viewvc/qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/QueueReplicator.cpp?rev=1228425&r1=1228424&r2=1228425&view=diff
==============================================================================
--- qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/QueueReplicator.cpp (original)
+++ qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/QueueReplicator.cpp Fri Jan  6 
21:54:58 2012
@@ -118,8 +118,6 @@ void QueueReplicator::initializeBridge(B
     peer.getMessage().flow(getName(), 0, 0xFFFFFFFF);
     peer.getMessage().flow(getName(), 1, 0xFFFFFFFF);
     QPID_LOG(debug, logPrefix << "Activated bridge from " << args.i_src << " 
to " << args.i_dest);
-    // Reset self reference so this will be deleted when all external refs are 
gone.
-    self.reset();
 }
 
 namespace {
@@ -150,13 +148,13 @@ void QueueReplicator::route(Deliverable&
     sys::Mutex::ScopedLock l(lock);
     if (key == DEQUEUE_EVENT_KEY) {
         SequenceSet dequeues = decodeContent<SequenceSet>(msg.getMessage());
-        QPID_LOG(trace, logPrefix << "Received dequeues: " << dequeues);
+        QPID_LOG(trace, logPrefix << "Dequeue update: " << dequeues);
         //TODO: should be able to optimise the following
         for (SequenceSet::iterator i = dequeues.begin(); i != dequeues.end(); 
i++)
             dequeue(*i, l);
     } else if (key == POSITION_EVENT_KEY) {
         SequenceNumber position = 
decodeContent<SequenceNumber>(msg.getMessage());
-        QPID_LOG(trace, logPrefix << "Advance position: from " << 
queue->getPosition()
+        QPID_LOG(trace, logPrefix << "Position update: from " << 
queue->getPosition()
                  << " to " << position);
         assert(queue->getPosition() <= position);
          //TODO aconway 2011-12-14: Optimize this?

Modified: 
qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp
URL: 
http://svn.apache.org/viewvc/qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp?rev=1228425&r1=1228424&r2=1228425&view=diff
==============================================================================
--- qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp 
(original)
+++ qpid/branches/qpid-3603/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp 
Fri Jan  6 21:54:58 2012
@@ -89,11 +89,10 @@ ReplicatingSubscription::ReplicatingSubs
     consumer(new DelegatingConsumer(*this))
 {
     stringstream ss;
-    string url = parent->getSession().getConnection().getUrl();
-    string qname = getQueue()->getName();
-    ss << "HA: Primary queue " << qname << ", backup " <<  url << ": ";
+    ss << "HA: Primary: " << getQueue()->getName() << " at "
+       << parent->getSession().getConnection().getUrl() << ": ";
     logPrefix = ss.str();
-    
+
     // FIXME aconway 2011-12-09: Failover optimization removed.
     // There was code here to re-use messages already on the backup
     // during fail-over. This optimization was removed to simplify
@@ -101,7 +100,7 @@ ReplicatingSubscription::ReplicatingSubs
     // can be re-introduced later. Last revision with the optimization:
     // r1213258 | QPID-3603: Fix QueueReplicator subscription parameters.
 
-    QPID_LOG(debug, logPrefix << "Created subscription " << name);
+    QPID_LOG(debug, logPrefix << "Created backup subscription " << getName());
 
     // FIXME aconway 2011-12-15: ConsumerImpl::position is left at 0
     // so we will start consuming from the lowest numbered message.
@@ -137,7 +136,7 @@ ReplicatingSubscription::~ReplicatingSub
 // Called in the subscription's connection thread.
 void ReplicatingSubscription::cancel()
 {
-    QPID_LOG(debug, logPrefix <<"Cancelled");
+    QPID_LOG(debug, logPrefix <<"Cancelled backup subscription " << getName());
     
getQueue()->removeObserver(boost::dynamic_pointer_cast<QueueObserver>(shared_from_this()));
 }
 

Modified: qpid/branches/qpid-3603/qpid/cpp/src/tests/qpid-cpp-benchmark
URL: 
http://svn.apache.org/viewvc/qpid/branches/qpid-3603/qpid/cpp/src/tests/qpid-cpp-benchmark?rev=1228425&r1=1228424&r2=1228425&view=diff
==============================================================================
--- qpid/branches/qpid-3603/qpid/cpp/src/tests/qpid-cpp-benchmark (original)
+++ qpid/branches/qpid-3603/qpid/cpp/src/tests/qpid-cpp-benchmark Fri Jan  6 
21:54:58 2012
@@ -147,7 +147,6 @@ def start_send(queue, opts, broker, host
                "--report-total",
                "--report-header=no",
                "--timestamp=%s"%(opts.timestamp and "yes" or "no"),
-               "--sequence=no",
                "--flow-control", str(opts.flow_control),
                "--durable", str(opts.durable)
                ]



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

Reply via email to