Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 12254 invoked from network); 13 Jan 2010 18:53:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2010 18:53:29 -0000 Received: (qmail 99702 invoked by uid 500); 13 Jan 2010 18:53:29 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 99665 invoked by uid 500); 13 Jan 2010 18:53:29 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 99655 invoked by uid 99); 13 Jan 2010 18:53:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 18:53:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajdavies@gmail.com designates 74.125.92.144 as permitted sender) Received: from [74.125.92.144] (HELO qw-out-1920.google.com) (74.125.92.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2010 18:53:19 +0000 Received: by qw-out-1920.google.com with SMTP id 5so40119qwc.26 for ; Wed, 13 Jan 2010 10:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=p3e/wIQ6Q2jx9LtoDJrMIrdUWBm6GJNDEW5b6ohe0nc=; b=kWBZzCPTYGdgc+z6pxFVI0QDjKyNdlOLSlEq5DitdcYLAKwoTak4/RrZ38+Oef9U9O BY5VWlZJOiEcsbZohwLXoV1BQyY0GehFGOoc4UBPY+pVCCaP2T1aqKfbME8U2MbF62L5 Y7z+eXMivWKy2x/KjgfEh66Ue4SZKGbHDtNBQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=f3uatrso3RIhoE1dOEdm/DAP9DdoKr4udR7MB5/bMJ0eyOUbg8g0UWSOau0EQuqhJ6 qV1ei6ZKZnCtldBxdjTPijGJOF/rBETLWXL1x5SFsDOtSxU6j7ogEaT/lNMfzmoyY9Zj bu7b01ElukDdr+Qsh7Cjnyu0btIql1hC9I0Ig= Received: by 10.224.63.219 with SMTP id c27mr673106qai.168.1263408775387; Wed, 13 Jan 2010 10:52:55 -0800 (PST) Received: from ?192.168.1.164? ([81.147.36.97]) by mx.google.com with ESMTPS id 22sm6464104qyk.2.2010.01.13.10.52.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Jan 2010 10:52:54 -0800 (PST) Message-Id: <1F71C463-E753-4098-93C0-B1544E040A26@gmail.com> From: Rob Davies To: users@activemq.apache.org In-Reply-To: <69b2d60e1001130950mf34dbey132a9880b48a17fc@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Trivial embedded broker not shutting down cleanly because of lingering threads Date: Wed, 13 Jan 2010 18:52:51 +0000 References: <69b2d60e1001130950mf34dbey132a9880b48a17fc@mail.gmail.com> X-Mailer: Apple Mail (2.936) Do you actually call stop() on the broker ? - Have you disabled the shutdownHook from the broker ? If you could post your code - or sample of it - might help identify why your main isn't shutting down On 13 Jan 2010, at 17:50, Fred Moore wrote: > Hi folks, > > we have a 5.3.0 embedded broker that refuses to shutdown cleanly > because of > lingering threads. > > We reproduced this with a very very basic configuration: with just > vm & jmx > connectors, no producers and no consumers and and this extremely > simple > main() program: http://pastebin.com/f2784245a that: > > 1\ Starts up an embedded broker > > 2\ Waits for the user to press a key > > 3\ Stops the broker > > 4\ Monitors (polling every few seconds) the number of lingering > threads > > What we experience is that after step 1\ (broker startup) this is > the list > of active threads... > > * [main] Group: main > * [ActiveMQ Scheduler] (Daemon) Group: main > * [ActiveMQ Data File Writer] (Daemon) Group: main > * [Timer-0] (Daemon) Group: main > * [JMX connector] (Daemon) Group: main > > ...but a long time (dozens of seconds) after step 3\ (broker > shutdown) these > threads are still active: > > * [main] Group: main > * [ActiveMQ Scheduler] (Daemon) Group: main > * [Timer-0] (Daemon) Group: main > > Questions: > Q1\ Are we missing something obvious? > Q2\ Is there a better way to shutdown an embedded broker? > Q3\ Doing it the hard way via system.exit() is going to get us into > worse > troubles? (data corruption & co) > > Thanks in advance for your help. > Cheers, > F. > > > > > The embedding was performed Rob Davies http://twitter.com/rajdavies I work here: http://fusesource.com My Blog: http://rajdavies.blogspot.com/ I'm writing this: http://www.manning.com/snyder/