You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dadoc <da...@gmail.com> on 2009/08/24 12:13:28 UTC

Garceful shutdown bug in 2.0M3?

Hi

While running camel-example-spring-jms in 2.0M3, I've noticed that
GracefulShutdownService can't stop Camel. It calls 

    Main.getInstance().stop();
    
but this call blocks and never returns. With enabled debug logging for
org.springframework.jms, console outputs

[aultMessageListenerContainer-1] efaultMessageListenerContainer DEBUG
Waiting for shutdown of message listener invokers
[aultMessageListenerContainer-1] efaultMessageListenerContainer DEBUG Still
waiting for shutdown of 1 message listener invokers

This looks like Camel doesn't clean itself properly at the shutdown, but I'm
not really sure of course.
Can anybody help, please?

Dado
-- 
View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25113519.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Garceful shutdown bug in 2.0M3?

Posted by Hadrian Zbarcea <hz...@gmail.com>.
I think there was an issue about daemon threads that sounded quite  
similar.

Hadrian

On Aug 27, 2009, at 3:52 AM, Claus Ibsen wrote:

> On Wed, Aug 26, 2009 at 5:08 PM, dadoc<da...@gmail.com> wrote:
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> If you do it by pure java, eg not letting spring handle the  
>>> lifecycle
>>> you have control and can shutdown all of them in nice order without
>>> problems.
>>>
>>
>> Please, is it possible to point at the relevant example, or to  
>> provide some
>> code example here? Tnx.
>>
>
> try using nabble / markmail etc. to search camel user forum for
> graceful shutdown as we have talked about this before.
> I think I posted some code how to stop in pure java, or at least I did
> have such code at that time.
>
> Feel free to create a ticket in JIRA so we wont forget and try to get
> it fixed / workaround in the next release.
>
>
>> Dado
>> --
>> View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25151413.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> -- 
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus


Re: Garceful shutdown bug in 2.0M3?

Posted by dadoc <da...@gmail.com>.


Claus Ibsen-2 wrote:
> 
> Just for the record I managed to track an issue down and have fixed it
> in Camel 2.1.
> 

This is great, and thank you.

Dado
-- 
View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25399923.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Garceful shutdown bug in 2.0M3?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Just for the record I managed to track an issue down and have fixed it
in Camel 2.1.

On Mon, Aug 31, 2009 at 9:07 AM, dadoc <da...@gmail.com> wrote:
>
>
> Claus Ibsen-2 wrote:
>>
>> Feel free to create a ticket in JIRA so we wont forget and try to get
>> it fixed / workaround in the next release.
>>
>
> I've created issue at  http://issues.apache.org/activemq/browse/CAMEL-1963
> http://issues.apache.org/activemq/browse/CAMEL-1963
>
> Dado
> --
> View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25219161.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Garceful shutdown bug in 2.0M3?

Posted by dadoc <da...@gmail.com>.

Claus Ibsen-2 wrote:
> 
> Feel free to create a ticket in JIRA so we wont forget and try to get
> it fixed / workaround in the next release.
> 

I've created issue at  http://issues.apache.org/activemq/browse/CAMEL-1963
http://issues.apache.org/activemq/browse/CAMEL-1963 

Dado
-- 
View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25219161.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Garceful shutdown bug in 2.0M3?

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Aug 26, 2009 at 5:08 PM, dadoc<da...@gmail.com> wrote:
>
>
> Claus Ibsen-2 wrote:
>>
>> If you do it by pure java, eg not letting spring handle the lifecycle
>> you have control and can shutdown all of them in nice order without
>> problems.
>>
>
> Please, is it possible to point at the relevant example, or to provide some
> code example here? Tnx.
>

try using nabble / markmail etc. to search camel user forum for
graceful shutdown as we have talked about this before.
I think I posted some code how to stop in pure java, or at least I did
have such code at that time.

Feel free to create a ticket in JIRA so we wont forget and try to get
it fixed / workaround in the next release.


> Dado
> --
> View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25151413.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Garceful shutdown bug in 2.0M3?

Posted by "m.s." <da...@arcor.de>.
Here is some more information about my issue:

I am using AMQ 5.2 and Camel 2.0. AMQ runs as a standalone application and I
configure Camel and the AMQ component via the Spring applicationContext.xml.

After stopping Tomcat, I get the following exception and Tomcat hangs:


> 27.08.2009 16:05:01 org.apache.coyote.http11.Http11Protocol pause
> INFO: Pausing Coyote HTTP/1.1 on http-8080
> 27.08.2009 16:05:02 org.apache.catalina.core.StandardService stop
> INFO: Stopping service Catalina
> Exception in thread "InactivityMonitor WriteCheck"
> java.lang.NullPointerException
>         at
> org.apache.commons.logging.impl.Log4JLogger.isDebugEnabled(Log4JLogger.java:224)
>         at
> org.apache.activemq.transport.InactivityMonitor$2.run(InactivityMonitor.java:98)
>         at
> org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
>         at java.util.TimerThread.mainLoop(Timer.java:512)
>         at java.util.TimerThread.run(Timer.java:462)
> Exception in thread "InactivityMonitor ReadCheck"
> java.lang.NullPointerException
>         at
> org.apache.commons.logging.impl.Log4JLogger.isDebugEnabled(Log4JLogger.java:224)
>         at
> org.apache.activemq.transport.InactivityMonitor$1.run(InactivityMonitor.java:71)
>         at
> org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
>         at java.util.TimerThread.mainLoop(Timer.java:512)
>         at java.util.TimerThread.run(Timer.java:462)
> 

After stopping AMQ, I get more exceptions, but Tomcat shuts down:


> 27.08.2009 16:05:13 org.apache.coyote.http11.Http11Protocol destroy
> INFO: Stopping Coyote HTTP/1.1 on http-8080
> Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616"
> java.lang.NullPointerException
>         at
> org.apache.activemq.transport.InactivityMonitor.stopMonitorThreads(InactivityMonitor.java:286)
>         at
> org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:243)
>         at
> org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:96)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:189)
>         at java.lang.Thread.run(Thread.java:619)
> Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616"
> Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616"
> Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616"
> Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61616"
> java.lang.NullPointerException
>         at
> org.apache.activemq.transport.InactivityMonitor.stopMonitorThreads(InactivityMonitor.java:286)
>         at
> org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:243)
>         at
> org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:96)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:189)
>         at java.lang.Thread.run(Thread.java:619)
> java.lang.NullPointerException
>         at
> org.apache.activemq.transport.InactivityMonitor.stopMonitorThreads(InactivityMonitor.java:286)
>         at
> org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:243)
>         at
> org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:96)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:189)
>         at java.lang.Thread.run(Thread.java:619)
> java.lang.NullPointerException
>         at
> org.apache.activemq.transport.InactivityMonitor.stopMonitorThreads(InactivityMonitor.java:286)
>         at
> org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:243)
>         at
> org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:96)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:189)
>         at java.lang.Thread.run(Thread.java:619)
> java.lang.NullPointerException
>         at
> org.apache.activemq.transport.InactivityMonitor.stopMonitorThreads(InactivityMonitor.java:286)
>         at
> org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:243)
>         at
> org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:96)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:189)
>         at java.lang.Thread.run(Thread.java:619)
> 

-- 
View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25168710.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Garceful shutdown bug in 2.0M3?

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 27, 2009 at 9:37 AM, m.s.<da...@arcor.de> wrote:
>
> I run an application that uses the ActiveMQ-Component on Tomcat. The server
> hangs if I try to stop it and only shuts down if I stop ActiveMQ that is
> running as a stand-alone application. Is this related to the same problem?
> It seems that open connections to ActiveMQ are the reason for the server not
> stopping.
> --

Yeah it could be likely be related to that. Try taking a thread dump
when it hangs, maybe it can help to pin point where AMQ is hanging.
And what version of AMQ are you using?



> View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25167231.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Garceful shutdown bug in 2.0M3?

Posted by "m.s." <da...@arcor.de>.
I run an application that uses the ActiveMQ-Component on Tomcat. The server
hangs if I try to stop it and only shuts down if I stop ActiveMQ that is
running as a stand-alone application. Is this related to the same problem?
It seems that open connections to ActiveMQ are the reason for the server not
stopping.
-- 
View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25167231.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Garceful shutdown bug in 2.0M3?

Posted by dadoc <da...@gmail.com>.

Claus Ibsen-2 wrote:
> 
> If you do it by pure java, eg not letting spring handle the lifecycle
> you have control and can shutdown all of them in nice order without
> problems.
> 

Please, is it possible to point at the relevant example, or to provide some
code example here? Tnx.

Dado
-- 
View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25151413.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Garceful shutdown bug in 2.0M3?

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Aug 25, 2009 at 1:47 PM, dmurat<da...@gmail.com> wrote:
>
> I'm having this same problem. Since I'm targeting embedded deployment in
> desktop app, it is kind of serious issue for me.
>

It is a harder problem to solve than at first though as Spring JMS
does not expose good methods to graceful / nicely shutdown.

And it can be part of ordering in you let spring handle the lifecycle
of Camel, JMS connection factories, JMS broker etc. if they
are defined in spring XML files.

At best effort we may add some brute force shutdown.

If you do it by pure java, eg not letting spring handle the lifecycle
you have control and can shutdown all of them in nice order without
problems.



> Best regards,
> Damir Murat
> --
> View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25132762.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Garceful shutdown bug in 2.0M3?

Posted by dmurat <da...@gmail.com>.
I'm having this same problem. Since I'm targeting embedded deployment in
desktop app, it is kind of serious issue for me.

Best regards,
Damir Murat
-- 
View this message in context: http://www.nabble.com/Garceful-shutdown-bug-in-2.0M3--tp25113519p25132762.html
Sent from the Camel - Users mailing list archive at Nabble.com.