Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9835318631 for ; Tue, 23 Feb 2016 23:27:07 +0000 (UTC) Received: (qmail 26494 invoked by uid 500); 23 Feb 2016 23:27:07 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 26435 invoked by uid 500); 23 Feb 2016 23:27:07 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 26419 invoked by uid 99); 23 Feb 2016 23:27:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Feb 2016 23:27:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 56F43E8E7C; Tue, 23 Feb 2016 23:27:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Tue, 23 Feb 2016 23:27:07 -0000 Message-Id: <85bcf1a3599d4007b0799d846136b1f6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/42] activemq-artemis git commit: ARTEMIS-350 small improvement on the writable logic [Forced Update!] Repository: activemq-artemis Updated Branches: refs/heads/refactor-openwire 0e545541b -> 562ad7980 (forced update) ARTEMIS-350 small improvement on the writable logic Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/6bdfe95f Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/6bdfe95f Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/6bdfe95f Branch: refs/heads/refactor-openwire Commit: 6bdfe95f665d19b868b8246358941b72419512ab Parents: 5abf5d3 Author: Clebert Suconic Authored: Tue Feb 23 15:03:57 2016 -0500 Committer: Clebert Suconic Committed: Tue Feb 23 15:04:49 2016 -0500 ---------------------------------------------------------------------- .../activemq/artemis/core/replication/ReplicationManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6bdfe95f/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java index 8f0774e..a393816 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java @@ -110,7 +110,7 @@ public final class ReplicationManager implements ActiveMQComponent, ReadyListene private volatile boolean enabled; - private final AtomicBoolean writable = new AtomicBoolean(false); + private final AtomicBoolean writable = new AtomicBoolean(true); private final Object replicationLock = new Object(); @@ -345,6 +345,7 @@ public final class ReplicationManager implements ActiveMQComponent, ReadyListene pendingTokens.add(repliToken); if (!replicatingChannel.getConnection().isWritable(this)) { try { + writable.set(false); //don't wait for ever as this may hang tests etc, we've probably been closed anyway long now = System.currentTimeMillis(); long deadline = now + 5000; @@ -352,7 +353,6 @@ public final class ReplicationManager implements ActiveMQComponent, ReadyListene replicationLock.wait(deadline - now); now = System.currentTimeMillis(); } - writable.set(false); } catch (InterruptedException e) { throw new ActiveMQInterruptedException(e);