qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject qpid-broker-j git commit: QPID-7854: Ensure that queue is not in-use as alternate binding before mutating deleted state
Date Fri, 07 Jul 2017 12:44:27 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master f98d11843 -> 8468aa00b


QPID-7854: Ensure that queue is not in-use as alternate binding before mutating deleted state


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/8468aa00
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/8468aa00
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/8468aa00

Branch: refs/heads/master
Commit: 8468aa00b96326feae0032e87600b823b7548175
Parents: f98d118
Author: Keith Wall <kwall@apache.org>
Authored: Fri Jul 7 13:43:41 2017 +0100
Committer: Keith Wall <kwall@apache.org>
Committed: Fri Jul 7 13:44:21 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/qpid/server/queue/AbstractQueue.java | 11 +++++------
 .../apache/qpid/server/queue/AbstractQueueTestBase.java  |  1 +
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/8468aa00/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
index 1ab48e2..6129402 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
@@ -1745,13 +1745,13 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>>
         // Check access
         authorise(Operation.DELETE);
 
-        if (_deleted.compareAndSet(false, true))
+        if(hasReferrers())
         {
-            if(hasReferrers())
-            {
-                throw new MessageDestinationIsAlternateException(getName());
-            }
+            throw new MessageDestinationIsAlternateException(getName());
+        }
 
+        if (_deleted.compareAndSet(false, true))
+        {
             final int queueDepthMessages = getQueueDepthMessages();
 
             for(MessageSender sender : _linkedSenders.keySet())
@@ -1761,7 +1761,6 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>>
 
             try
             {
-
                 Iterator<QueueConsumer<?,?>> consumerIterator = _queueConsumerManager.getAllIterator();
 
                 while (consumerIterator.hasNext())

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/8468aa00/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
----------------------------------------------------------------------
diff --git a/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
b/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
index 1d1578c..bdf4f31 100644
--- a/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
+++ b/broker-core/src/test/java/org/apache/qpid/server/queue/AbstractQueueTestBase.java
@@ -1052,6 +1052,7 @@ abstract class AbstractQueueTestBase extends QpidTestCase
         {
             //pass
         }
+        assertFalse(_queue.isDeleted());
     }
 
     private long getExpirationOnQueue(final Queue<?> queue, long arrivalTime, long
expiration)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message