You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/04/15 05:16:08 UTC
activemq-artemis git commit: ARTEMIS-482 Cleanup new ThreadPool on
the testsuite to avoid leak report
Repository: activemq-artemis
Updated Branches:
refs/heads/master ec73961f7 -> b7118df7d
ARTEMIS-482 Cleanup new ThreadPool on the testsuite to avoid leak report
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b7118df7
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b7118df7
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b7118df7
Branch: refs/heads/master
Commit: b7118df7d03cc2d5a540a8d46e1cdfde0419a69a
Parents: ec73961
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Apr 14 23:12:48 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Apr 14 23:14:22 2016 -0400
----------------------------------------------------------------------
.../artemis/core/remoting/impl/invm/InVMConnector.java | 7 +++++++
.../apache/activemq/artemis/tests/util/ActiveMQTestBase.java | 3 +++
2 files changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7118df7/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
index 0783d7c..c222d0d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
@@ -94,6 +94,13 @@ public class InVMConnector extends AbstractConnector {
private static ExecutorService threadPoolExecutor;
+ public static void resetThreadPool() {
+ if (threadPoolExecutor != null) {
+ threadPoolExecutor.shutdown();
+ threadPoolExecutor = null;
+ }
+ }
+
private static ExecutorService getInVMExecutor() {
if (threadPoolExecutor == null) {
if (ActiveMQClient.globalThreadMaxPoolSize <= -1) {
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7118df7/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
index 4fd98db..13868b2 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
@@ -96,6 +96,7 @@ import org.apache.activemq.artemis.core.postoffice.PostOffice;
import org.apache.activemq.artemis.core.postoffice.QueueBinding;
import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
+import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnector;
import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
import org.apache.activemq.artemis.core.remoting.impl.invm.InVMRegistry;
import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
@@ -235,6 +236,8 @@ public abstract class ActiveMQTestBase extends Assert {
closeAllSessionFactories();
closeAllServerLocatorsFactories();
+ InVMConnector.resetThreadPool();
+
try {
assertAllExecutorsFinished();
assertAllClientConsumersAreClosed();