From users-return-11456-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Fri Nov 16 15:12:45 2007 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 48007 invoked from network); 16 Nov 2007 15:12:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Nov 2007 15:12:45 -0000 Received: (qmail 90882 invoked by uid 500); 16 Nov 2007 15:12:32 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 90863 invoked by uid 500); 16 Nov 2007 15:12:32 -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 90854 invoked by uid 99); 16 Nov 2007 15:12:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2007 07:12:31 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 209.85.198.191 as permitted sender) Received: from [209.85.198.191] (HELO rv-out-0910.google.com) (209.85.198.191) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2007 15:12:20 +0000 Received: by rv-out-0910.google.com with SMTP id l15so623479rvb for ; Fri, 16 Nov 2007 07:12:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=65UZ6cTlKbV/8RfVDU4wczJNBBLtCHu8FyoIYeQZEZE=; b=AnXdHX/7I+h6QS+6EtdJ4YFWWchiDaiL/E3Q9aU4YxRXMM1nZKdaO3B1J17I65yTnn8FlnsFBhDBKFhb4VBurpiKSDuu1ae7PYLpzkSE7eNbQEmtXYQC35v8V5kzKWi5PJeGOj1aW4aCWMFbIuytUhQKoL7G3HPGbh4hJWX7cOk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CYhzfqj775p+ZDAyk4Jcv+e6ZfxCLWCtku4exUtObzdBU+Of0PWnqNXLDMRzO5l3Cty9j7pkGFt6h+vEt8gz9mQHrHNq2XvujZTxcUqWbw2kpygxNAJTVhSTPomgfv835N70N1S9xvkkgHrmpkI7iOSGzfhbhIWlaRZdZZl/yo0= Received: by 10.141.99.4 with SMTP id b4mr666801rvm.1195225933779; Fri, 16 Nov 2007 07:12:13 -0800 (PST) Received: by 10.65.204.2 with HTTP; Fri, 16 Nov 2007 07:12:13 -0800 (PST) Message-ID: Date: Fri, 16 Nov 2007 15:12:13 +0000 From: "James Strachan" To: users@activemq.apache.org Subject: Re: Closing a MessageConsumer hangs if broker already down In-Reply-To: <13794930.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13790718.post@talk.nabble.com> <13794930.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Sorry I misread the stack trace - I thought it was a Connection.close rather than a consumer.close(). I think all the .close() methods should have a timeout and silently complete if the transport is down. On 16/11/2007, TOPPER_HARLEY wrote: > > Strange, just tried it again there with a basic AMQ test (no RCP etc), and I > get exception when closing listeners "Transport is not running" and app > exits OK. Its the same version of AMQ. What is the behaviour that you would > expect, hang or exception? > > > James.Strachan wrote: > > > > BTW does the same thing occur in ActiveMQ 5.x? IIRC there's now a > > timeout on closing things down avoiding this block > > > > On 16/11/2007, TOPPER_HARLEY wrote: > >> > >> Hi, > >> Using AMQ4.1.1 with standalone server with embedded broker. Client apps > >> have > >> Spring message listeners. If we have client and server running ok and > >> then > >> server is shutdown, along with the broker inside it, any client that is > >> left > >> open cannot cleanly shutdown as it hangs trying to close its message > >> listeners. Below is the stack of the main thread that is hung: > >> > >> - Object.wait(long, int) line: not available [native method] > >> - CondVar(Object).wait() line: 199 > >> - CondVar.await() line: 75 > >> - ArrayBlockingQueue.take() line: 318 > >> - FutureResponse.getResult() line: 42 > >> - ResponseCorrelator.request(Object) line: 75 > >> - ActiveMQConnection.syncSendPacket(Command) line: 1175 > >> - ActiveMQSession.syncSendPacket(Command) line: 1663 > >> - ActiveMQMessageConsumer.close() line: 542 > >> - JmsUtils.closeMessageConsumer(MessageConsumer) line: 144 > >> - SimpleMessageListenerContainer.doShutdown() line: 219 > >> - > >> SimpleMessageListenerContainer(AbstractJmsListeningContainer).shutdown() > >> line: 294 > >> - SimpleMessageListenerContainer(AbstractJmsListeningContainer).destroy() > >> line: 264 > >> - DisposableBeanAdapter.destroy() line: 145 > >> - > >> DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroyBean(String, > >> DisposableBean) line: 347 > >> - > >> DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroySingleton(String) > >> line: 320 > >> - > >> DefaultListableBeanFactory(DefaultSingletonBeanRegistry).destroySingletons() > >> line: 293 > >> - > >> FileSystemXmlApplicationContext(AbstractApplicationContext).destroyBeans() > >> line: 706 > >> - FileSystemXmlApplicationContext(AbstractApplicationContext).doClose() > >> line: 684 > >> - FileSystemXmlApplicationContext(AbstractApplicationContext).close() > >> line: > >> 651 > >> - TopologyServiceFactory.dispose(Preferences) line: 567 > >> - Activator.stop(BundleContext) line: 35 > >> - BundleContextImpl$3.run() line: 1040 > >> - AccessController.doPrivileged(PrivilegedExceptionAction) line: 242 > >> - BundleContextImpl.stop() line: 1036 > >> - BundleHost.stopWorker(int) line: 457 > >> - BundleHost(AbstractBundle).suspend(boolean) line: 526 > >> - Framework.suspendBundle(AbstractBundle, boolean) line: 1148 > >> - StartLevelManager.decFWSL(int, AbstractBundle[]) line: 675 > >> - StartLevelManager.doSetStartLevel(int, AbstractBundle) line: 291 > >> - StartLevelManager.shutdown() line: 261 > >> - SystemBundle.suspend() line: 188 > >> - Framework.shutdown() line: 622 > >> - Framework.close() line: 525 > >> - OSGi.close() line: 41 > >> - EclipseStarter.shutdown() line: 399 > >> - EclipseStarter.run(String[], Runnable) line: 197 > >> - NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not > >> available [native method] > >> - NativeMethodAccessorImpl.invoke(Object, Object[]) line: 64 > >> - DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 > >> - Method.invoke(Object, Object...) line: 615 > >> - Main.invokeFramework(String[], URL[]) line: 504 > >> - Main.basicRun(String[]) line: 443 > >> - Main.run(String[]) line: 1169 > >> - Main.main(String[]) line: 1144 > >> > >> > >> This results in the client JVM never exiting! Should there be some > >> timeout > >> on this or something to guard against this since it is a common scenario > >> I > >> would have thought? > >> > >> Thanks > >> /Tom > >> > >> > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Closing-a-MessageConsumer-hangs-if-broker-already-down-tf4820370s2354.html#a13790718 > >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. > >> > >> > > > > > > -- > > James > > ------- > > http://macstrac.blogspot.com/ > > > > Open Source SOA > > http://open.iona.com > > > > > > -- > View this message in context: http://www.nabble.com/Closing-a-MessageConsumer-hangs-if-broker-already-down-tf4820370s2354.html#a13794930 > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- James ------- http://macstrac.blogspot.com/ Open Source SOA http://open.iona.com