Repository: activemq-artemis Updated Branches: refs/heads/master 9d80d548a -> d81ba8f81
fixing intermittent lockdown on the testsuite Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/73b000b3 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/73b000b3 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/73b000b3 Branch: refs/heads/master Commit: 73b000b3c006186bded2a53339a609195e436c8a Parents: 9d80d54 Author: Clebert Suconic <[email protected]> Authored: Thu Jan 7 13:58:01 2016 -0500 Committer: Clebert Suconic <[email protected]> Committed: Thu Jan 7 13:58:01 2016 -0500 ---------------------------------------------------------------------- .../core/server/impl/ServerConsumerImpl.java | 28 ++++++++------------ 1 file changed, 11 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/73b000b3/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java index 7936c76..fc5e24f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java @@ -559,15 +559,7 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener { @Override public void setStarted(final boolean started) { synchronized (lock) { - // This is to make sure that the delivery process has finished any pending delivery - // otherwise a message may sneak in on the client while we are trying to stop the consumer - lockDelivery.writeLock().lock(); - try { - this.started = browseOnly || started; - } - finally { - lockDelivery.writeLock().unlock(); - } + this.started = browseOnly || started; } // Outside the lock @@ -579,16 +571,18 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener { @Override public void setTransferring(final boolean transferring) { synchronized (lock) { - // This is to make sure that the delivery process has finished any pending delivery - // otherwise a message may sneak in on the client while we are trying to stop the consumer + this.transferring = transferring; + } + + // This is to make sure that the delivery process has finished any pending delivery + // otherwise a message may sneak in on the client while we are trying to stop the consumer + try { lockDelivery.writeLock().lock(); - try { - this.transferring = transferring; - } - finally { - lockDelivery.writeLock().unlock(); - } } + finally { + lockDelivery.writeLock().unlock(); + } + // Outside the lock if (transferring) {
