From d1f42bd01e90abe3fb171834efd46a3594ba2600 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Wed, 2 Nov 2016 12:41:25 -0400 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-6474 ASYNC_TASKS executor not being shut down on stop with no other users in service. --- .../activemq/transport/AbstractInactivityMonitor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/AbstractInactivityMonitor.java b/activemq-client/src/main/java/org/apache/activemq/transport/AbstractInactivityMonitor.java index 7bd19c41b5..fa46a0e4d7 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/AbstractInactivityMonitor.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/AbstractInactivityMonitor.java @@ -30,6 +30,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.activemq.command.KeepAliveInfo; import org.apache.activemq.command.WireFormatInfo; import org.apache.activemq.thread.SchedulerTimerTask; +import org.apache.activemq.util.ThreadPoolUtils; import org.apache.activemq.wireformat.WireFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -499,6 +500,11 @@ public abstract class AbstractInactivityMonitor extends TransportFilter { READ_CHECK_TIMER.cancel(); WRITE_CHECK_TIMER = null; READ_CHECK_TIMER = null; + try { + ThreadPoolUtils.shutdownGraceful(ASYNC_TASKS, TimeUnit.SECONDS.toMillis(10)); + } finally { + ASYNC_TASKS = null; + } } } }