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 23837199F7 for ; Fri, 15 Apr 2016 03:16:10 +0000 (UTC) Received: (qmail 55060 invoked by uid 500); 15 Apr 2016 03:16:09 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 55015 invoked by uid 500); 15 Apr 2016 03:16:08 -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 55006 invoked by uid 99); 15 Apr 2016 03:16:08 -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; Fri, 15 Apr 2016 03:16:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 72C0DDFC55; Fri, 15 Apr 2016 03:16:08 +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 Message-Id: <91e4058ca7764ff58379236492147e13@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: activemq-artemis git commit: ARTEMIS-482 Cleanup new ThreadPool on the testsuite to avoid leak report Date: Fri, 15 Apr 2016 03:16:08 +0000 (UTC) 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 Authored: Thu Apr 14 23:12:48 2016 -0400 Committer: Clebert Suconic 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();