https://issues.apache.org/jira/browse/AMQ-4540 - wait for a max of 30 seconds for pending forwards to complete

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1483605 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2013-05-16 23:32:31 +00:00
parent 6f124c16f7
commit 3ded22df3d
1 changed files with 3 additions and 2 deletions

View File

@ -18,6 +18,7 @@ package org.apache.activemq.network;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@ -101,13 +102,13 @@ public class DemandSubscription {
if (dispatched.get() > 0) {
synchronized (activeWaiter) {
try {
activeWaiter.wait();
activeWaiter.wait(TimeUnit.SECONDS.toMillis(30));
} catch (InterruptedException ignored) {
}
}
if (this.dispatched.get() > 0) {
LOG.warn("demand sub interrupted or timedout while waiting for outstanding responses, " +
"expect potentially " + this.dispatched.get() + " duplicate deliveried");
"expect potentially " + this.dispatched.get() + " duplicate forwards");
}
}
}