mirror of https://github.com/apache/activemq.git
Fixing OpenWireConnectionTimeoutTest.
- It seems checking configuredOk can't be done that early. - Falling back to let the Timer be created and make sure it is disposed of.
This commit is contained in:
parent
40bedf7f0c
commit
e8cf40e24f
|
@ -437,6 +437,17 @@ public abstract class AbstractInactivityMonitor extends TransportFilter {
|
|||
synchronized (AbstractInactivityMonitor.class) {
|
||||
READ_CHECK_TIMER.purge();
|
||||
CHECKER_COUNTER--;
|
||||
if (CHECKER_COUNTER == 0) {
|
||||
if (READ_CHECK_TIMER != null) {
|
||||
READ_CHECK_TIMER.cancel();
|
||||
READ_CHECK_TIMER = null;
|
||||
}
|
||||
try {
|
||||
ThreadPoolUtils.shutdownGraceful(ASYNC_TASKS, 0);
|
||||
} finally {
|
||||
ASYNC_TASKS = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -497,10 +508,14 @@ public abstract class AbstractInactivityMonitor extends TransportFilter {
|
|||
READ_CHECK_TIMER.purge();
|
||||
CHECKER_COUNTER--;
|
||||
if (CHECKER_COUNTER == 0) {
|
||||
WRITE_CHECK_TIMER.cancel();
|
||||
READ_CHECK_TIMER.cancel();
|
||||
WRITE_CHECK_TIMER = null;
|
||||
READ_CHECK_TIMER = null;
|
||||
if (WRITE_CHECK_TIMER != null) {
|
||||
WRITE_CHECK_TIMER.cancel();
|
||||
WRITE_CHECK_TIMER = null;
|
||||
}
|
||||
if (READ_CHECK_TIMER != null) {
|
||||
READ_CHECK_TIMER.cancel();
|
||||
READ_CHECK_TIMER = null;
|
||||
}
|
||||
try {
|
||||
ThreadPoolUtils.shutdownGraceful(ASYNC_TASKS, 0);
|
||||
} finally {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class InactivityMonitor extends AbstractInactivityMonitor {
|
|||
|
||||
@Override
|
||||
public void start() throws Exception {
|
||||
if (!isMonitorStarted() && configuredOk()) {
|
||||
if (!isMonitorStarted()) {
|
||||
startConnectCheckTask();
|
||||
}
|
||||
super.start();
|
||||
|
|
Loading…
Reference in New Issue