You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by TOPPER_HARLEY <TR...@ERICSSON.COM> on 2007/11/16 11:29:29 UTC

Closing a MessageConsumer hangs if broker already down

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<T>) 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.


Re: Closing a MessageConsumer hangs if broker already down

Posted by James Strachan <ja...@gmail.com>.
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 <TR...@ericsson.com> 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 <TR...@ericsson.com> 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<T>) 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

Re: Closing a MessageConsumer hangs if broker already down

Posted by TOPPER_HARLEY <TR...@ERICSSON.COM>.
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 <TR...@ericsson.com> 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<T>) 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.


Re: Closing a MessageConsumer hangs if broker already down

Posted by James Strachan <ja...@gmail.com>.
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 <TR...@ericsson.com> 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<T>) 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