From eb6acf1347178746633d9cc5611034f505b8d98b Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 24 Oct 2012 14:33:09 +0000 Subject: 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. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1401709 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SemanticState.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index 767305af81..6e42f8d746 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -432,9 +432,9 @@ void SemanticState::cancel(ConsumerImpl::shared_ptr c) 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(); } -- cgit v1.2.1