Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 69657 invoked from network); 9 Jul 2008 17:52:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2008 17:52:59 -0000 Received: (qmail 769 invoked by uid 500); 9 Jul 2008 17:53:00 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 743 invoked by uid 500); 9 Jul 2008 17:53:00 -0000 Mailing-List: contact dev-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 dev@activemq.apache.org Received: (qmail 732 invoked by uid 99); 9 Jul 2008 17:52:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 10:52:59 -0700 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 17:52:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9C2D8234C160 for ; Wed, 9 Jul 2008 10:52:00 -0700 (PDT) Message-ID: <1830808070.1215625920638.JavaMail.jira@brutus> Date: Wed, 9 Jul 2008 10:52:00 -0700 (PDT) From: "james defelice (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQ-1470) There is no way to cleanly shutdown ActiveMQ In-Reply-To: <32042244.1192715063243.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44124#action_44124 ] james defelice commented on AMQ-1470: ------------------------------------- Any idea if this will be fixed for the 4.x release? If so, what does the timeline look like? > There is no way to cleanly shutdown ActiveMQ > -------------------------------------------- > > Key: AMQ-1470 > URL: https://issues.apache.org/activemq/browse/AMQ-1470 > Project: ActiveMQ > Issue Type: Improvement > Components: Connector, Test Cases, Transport > Affects Versions: 4.1.1 > Reporter: Aaron Digulla > Assignee: Rob Davies > Fix For: 5.2.0 > > > I need to test and build a highly reliable AMQ application. I'm using JUnit for my test cases and Tomcat as webserver. > My problem is that after closing all connections and sessions, there are still many threads hanging around. This makes it impossible to undeploy the webapp in Tomcat and it makes test cases unreliable since I can't guarantee that the environment is clean. > So far, I have identifier the following issues: > - If FailoverTransport hangs in oneway() because the AMQ server is not running, there is no way to stop it. Sending the thread an interrupt will only cause an endless loop (missing break in catch of InterruptedException after "Waiting for transport to reconnect."). > - Even if I interrupt the thread, it's not sure what it will do next. It might try to reconnect the next moment because I can't dispose the connection because of a deadlock in ActiveMQConnection (see http://www.nabble.com/Reliably-starting-and-stopping-of-a-producer-consumer-tf4600635s2354.html#a13229979). > - After fixing those two, I see two thread pools left: Scheduler.clockDaemon and ActiveMQConnectionFactory.DEFAULT_CONNECTION_EXECUTOR. Both won't stop running which means that there will be references to AMQ so Tomcat can't undeploy the application. > I tried to call shutdownNow() on the executors which gets me halfway where I need to be but now, the tests fail because when I try to create the next connection after a shutdown, the executors are in an illegal state (TERMINATED instead of RUNNING). My solution here was to kill the executors and recreate them in my tests. > But there should be a better way to do this :-) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.