diff options
author | Alan Conway <aconway@apache.org> | 2016-06-22 20:41:55 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2016-06-22 20:41:55 +0000 |
commit | 7b8a91375dc0528e2c15686ab71c3647ac3e2f96 (patch) | |
tree | 37b11722254d3109e23ebe676a1137840120a107 /qpid/cpp/src/qpid/broker/Broker.cpp | |
parent | e1d9be1b3590c79a0b2a6b6ad4cd3e6a65877401 (diff) | |
download | qpid-python-7b8a91375dc0528e2c15686ab71c3647ac3e2f96.tar.gz |
QPID-7306: Fix race conditions during Queue destruction.
Stack traces indicate a Queue was being destroyed concurrently while still in
use by its ManagedObject.
ManagedObject holds a plain pointer to the Manageable object (e.g. Queue) it
belongs to. The Manageable calls ManagedObject::resourceDestroy() when it is
deleted, but without any locking.
Added a locked wrapper class ManageablePtr so destroy is atomic with respect to
other calls via ManageablePtr, calls after pointer is reset to 0 in destroy()
are skipped.
Call resourceDestroy() in Queue::~Queue if it was not called already. This is
probably redundant given given the fixes above but can't hurt.
Queue::destroyed() was also being called without locking and could be called
concurrrently, e.g. if auto-delete happens concurrently with delete via QMF or
by a 0-10 client. Moved the destroyed() call into QueueRegistry::destroy(),
using QueueRegistry lock to guarantee it is called exactly once.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1749782 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/broker/Broker.cpp')
-rw-r--r-- | qpid/cpp/src/qpid/broker/Broker.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp index 055eba4f13..77674692ab 100644 --- a/qpid/cpp/src/qpid/broker/Broker.cpp +++ b/qpid/cpp/src/qpid/broker/Broker.cpp @@ -1496,7 +1496,6 @@ void Broker::deleteQueue(const std::string& name, const std::string& userId, queue->isRedirectSource() ? peerQ : queue, false); queues.destroy(name, connectionId, userId); - queue->destroyed(); } else { throw framing::NotFoundException(QPID_MSG("Delete failed. No such queue: " << name)); } |