Author: aconway
Date: Wed Oct 24 14:33:09 2012
New Revision: 1401709

URL: http://svn.apache.org/viewvc?rev=1401709&view=rev
Log:
Bug 868364 - QPID-4391: HA replicating subscriptions should not auto-delete 
queues

When an auto-delete queue is replicated, the replicating subscription attempts
to auto-delete the queue after it has already been auto-deleted by the closing
of the last non-HA consumer.  An issue occurs if a new auto-delete queue with
the same name is created shortly after the deletion of the previously queue.
This can occur when a client subscribes to an auto-delete queue and is
temporarily disconnected from the broker.  It is possible for the cancelled HA
subscription to remove the newly created queue from the queue registry since the
old and new queues use the same names.  The HA replicating subscription should
not execute the auto-delete logic when the subscription is cancelled.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=1401709&r1=1401708&r2=1401709&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Wed Oct 24 14:33:09 
2012
@@ -432,9 +432,9 @@ void SemanticState::cancel(ConsumerImpl:
     Queue::shared_ptr queue = c->getQueue();
     if(queue) {
         queue->cancel(c);
-        if (queue->canAutoDelete() && !queue->hasExclusiveOwner()) {
+        // Only run auto-delete for counted consumers.
+        if (c->isCounted() && queue->canAutoDelete() && 
!queue->hasExclusiveOwner())
             Queue::tryAutoDelete(session.getBroker(), queue, connectionId, 
userID);
-        }
     }
     c->cancel();
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to