summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SemanticState.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-10-24 14:33:09 +0000
committerAlan Conway <aconway@apache.org>2012-10-24 14:33:09 +0000
commitbee6a34003d915fa0017802f4586a5e06d18fd7a (patch)
treeeb17fdc53a8ff2cffa324b4901aee7ee0d567c11 /cpp/src/qpid/broker/SemanticState.cpp
parent58e272db372e3ee1cd45badf3cf346744dcecae7 (diff)
downloadqpid-python-bee6a34003d915fa0017802f4586a5e06d18fd7a.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp4
1 files changed, 2 insertions, 2 deletions
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();
}