diff options
author | Gordon Sim <gsim@apache.org> | 2013-10-31 18:37:49 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2013-10-31 18:37:49 +0000 |
commit | 81c95a528a716800efac7b90667c83dfe2149c6e (patch) | |
tree | 6e56bd667758af5789abe91aa3147db92919baa2 /qpid/cpp/src | |
parent | 9637a0498399980bbc60311239d6368875d6f92b (diff) | |
download | qpid-python-81c95a528a716800efac7b90667c83dfe2149c6e.tar.gz |
QPID-5283: ensure queue has no consumers before granting exclusive ownership
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1537579 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r-- | qpid/cpp/src/qpid/broker/Queue.cpp | 2 | ||||
-rwxr-xr-x | qpid/cpp/src/tests/acl.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp index 19b18e1b0e..a805e110ad 100644 --- a/qpid/cpp/src/qpid/broker/Queue.cpp +++ b/qpid/cpp/src/qpid/broker/Queue.cpp @@ -1323,7 +1323,7 @@ bool Queue::setExclusiveOwner(const OwnershipToken* const o) autoDeleteTask->cancel(); } Mutex::ScopedLock locker(messageLock); - if (owner) { + if (owner || users.hasConsumers()) { return false; } else { owner = o; diff --git a/qpid/cpp/src/tests/acl.py b/qpid/cpp/src/tests/acl.py index fe8254a6fa..66705e6d24 100755 --- a/qpid/cpp/src/tests/acl.py +++ b/qpid/cpp/src/tests/acl.py @@ -1570,7 +1570,8 @@ class ACLTests(TestBase010): session = self.get_session('bob','bob') try: - session.message_subscribe(queue='q3', destination='myq1') + session.message_subscribe(queue='q3', destination='myq3') + session.message_cancel(destination='myq3') except qpid.session.SessionException, e: if (403 == e.args[0].error_code): self.fail("ACL should allow subscription for q3"); |