You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2012/10/31 10:57:12 UTC

[jira] [Commented] (CAMEL-5762) StackOverflowError when repeatedly stopping/starting route

    [ https://issues.apache.org/jira/browse/CAMEL-5762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487648#comment-13487648 ] 

Claus Ibsen commented on CAMEL-5762:
------------------------------------

You should use suspend/resume when you do it so frequently. Especially with resources like JMS.
                
> StackOverflowError when repeatedly stopping/starting route
> ----------------------------------------------------------
>
>                 Key: CAMEL-5762
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5762
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.2
>            Reporter: Chris Watts
>
> Essentially when repeatedly stopping and starting a route (consuming from JMS queue) it eventually starts throwing StackOverflowError.
> {code:java}
> while (true) {
>    camelContext.stopRoute("route", 1500, TimeUnit.MILLISECONDS);
>    Thread.sleep(1000);
>    camelContext.startRoute("route", 1500, TimeUnit.MILLISECONDS);
>    Thread.sleep(1000);
> }{code}
> Log is:
> {noformat}2012-10-30 07:00:34,701 INFO Thread1 MyTestThread - stopRoute mainInRoute
> 2012-10-30 07:00:34,701 INFO Thread1 org.apache.camel.impl.DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 1500 milliseconds)
> 2012-10-30 07:00:34,808 WARN Camel (camel) thread #4 - ShutdownTask org.apache.camel.impl.DefaultShutdownStrategy - Error occurred while shutting down route: Consumer[activemq://queue:test.queue?maxConcurrentConsumers=1]. This exception will be ignored.
> java.lang.StackOverflowError
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:104)
> 	at org.apache.camel.processor.UnmarshalProcessor.doStop(UnmarshalProcessor.java:105)
> 	at org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
> 	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.stop(AsyncProcessorConverterHelper.java:96)
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
> 	at org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
> 	at org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
> 	at org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
> 	at org.apache.camel.processor.interceptor.TraceInterceptor.doStop(TraceInterceptor.java:364)
> 	at org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
> ......
> 	at org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
> 	at org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
> 	at org.apache.camel.processor.DelegateAsyncProcessor.doStop(DelegateAsyncProcessor.java:82)
> 	at org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:91)
> 	at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:112)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:128)
> 	at org.apache.camel.util.ServiceHelper.stopServices(ServiceHelper.java:97)
> 2012-10-30 07:00:34,867 INFO Camel (camel) thread #4 - ShutdownTask org.apache.camel.impl.DefaultShutdownStrategy - Route: mainInRoute shutdown complete, was consuming from: Endpoint[activemq://queue:test.queue?maxConcurrentConsumers=1]
> 2012-10-30 07:00:34,868 INFO Thread1 org.apache.camel.impl.DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds
> 2012-10-30 07:00:34,872 INFO Thread1 org.apache.camel.spring.SpringCamelContext - Route: mainInRoute stopped, was consuming from: Endpoint[activemq://queue:test.queue?maxConcurrentConsumers=1]{noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira