You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by miljenko <mi...@2e-systems.com> on 2013/06/03 15:01:25 UTC

Graceful shutdown not working

Hi,

I've got graceful shutdown issue that can be reproduced with this route:


		errorHandler(deadLetterChannel("direct:queue2")
                        .maximumRedeliveries(1)
                );

                from("seda:queue1")
                .log("Checkpoint 1")
                .split(body())
                    .log("Checkpoint 2")
                .end()
                .log("Checkpoint 3");
                        

                from("direct:queue2")
                .log("Checkpoint 4");


If ".maximumRedeliveries(1)" is commented out, it works as expected, but
with this line, message stays in flight and "Checkpoint 2" is never reached.

Is this a Camel bug, if not, how can it be fixed?

Best regards,
Miljenko



--
View this message in context: http://camel.465427.n5.nabble.com/Graceful-shutdown-not-working-tp5733697.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Graceful shutdown not working

Posted by miljenko <mi...@2e-systems.com>.
Tested, it works :)



--
View this message in context: http://camel.465427.n5.nabble.com/Graceful-shutdown-not-working-tp5733697p5735648.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Graceful shutdown not working

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

Thanks for reporting and providing the thread dumps.

I logged a ticket and have a potential fix in the works. Would be
great if you could test the fix in your system
https://issues.apache.org/jira/browse/CAMEL-6421



On Tue, Jun 4, 2013 at 8:52 AM, miljenko <mi...@2e-systems.com> wrote:
> I've tested with versions 2.10.3 and 2.11.0.
>
> This is just a short example that can reproduce described problem. You can
> put anything else in the splitter, it will not be reached.
>
> Reducing unnecessary code showed that example worked if "seda" was replaced
> with "direct" or "maximumRedeliveries" removed, so I guess problem is
> somehow related to that.
>
> Here is stack trace after it got stucked (I've paused the thread):
>
> Daemon Thread [Camel (camel-1) thread #0 - seda://queue1] (Suspended)
>         DefaultCamelContext.getErrorHandlerExecutorService() line: 1321
>         DeadLetterChannel(RedeliveryErrorHandler).doStart() line: 1131
>         DeadLetterChannel(ChildServiceSupport).start(boolean) line: 41
>         DeadLetterChannel(ChildServiceSupport).start() line: 28
>         ServiceHelper.startService(Service) line: 64
>         ServiceHelper.startService(Object) line: 54
>         ServiceHelper.startServices(Object...) line: 75
>         RouteContextProcessor(DelegateAsyncProcessor).doStart() line: 78
>         RouteContextProcessor(ServiceSupport).start() line: 61
>         ServiceHelper.startService(Service) line: 64
>         ServiceHelper.startService(Object) line: 54
>         ServiceHelper.startServices(Object...) line: 75
>         UnitOfWorkProcessor(DelegateAsyncProcessor).doStart() line: 78
>         UnitOfWorkProcessor.doStart() line: 88
>         UnitOfWorkProcessor(ServiceSupport).start() line: 61
>         ServiceHelper.startService(Service) line: 64
>         ServiceHelper.startService(Object) line: 54
>         ServiceHelper.startServices(Object...) line: 75
>         Splitter(MulticastProcessor).createErrorHandler(RouteContext, Exchange,
> Processor) line: 876
>         Splitter(MulticastProcessor).createProcessorExchangePair(int, Processor,
> Exchange, RouteContext) line: 833
>         Splitter$1$1.next() line: 178
>         Splitter$1$1.next() line: 133
>         Splitter.createProcessorExchangePairsList(Exchange, Object) line: 195
>         Splitter.createProcessorExchangePairs(Exchange) line: 113
>         Splitter(MulticastProcessor).process(Exchange, AsyncCallback) line: 206
>         Splitter.process(Exchange, AsyncCallback) line: 98
>         AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
> 73
>         BacklogTracerInterceptor(DelegateAsyncProcessor).processNext(Exchange,
> AsyncCallback) line: 99
>         BacklogTracerInterceptor(DelegateAsyncProcessor).process(Exchange,
> AsyncCallback) line: 90
>         BacklogTracerInterceptor.process(Exchange, AsyncCallback) line: 84
>         AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
> 73
>         TraceInterceptor(DelegateAsyncProcessor).processNext(Exchange,
> AsyncCallback) line: 99
>         TraceInterceptor(DelegateAsyncProcessor).process(Exchange, AsyncCallback)
> line: 90
>         TraceInterceptor.process(Exchange, AsyncCallback) line: 163
>         AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
> 73
>         DeadLetterChannel(RedeliveryErrorHandler).processErrorHandler(Exchange,
> AsyncCallback, RedeliveryErrorHandler$RedeliveryData) line: 390
>         DeadLetterChannel(RedeliveryErrorHandler).process(Exchange, AsyncCallback)
> line: 273
>         RouteContextProcessor.processNext(Exchange, AsyncCallback) line: 46
>         RouteContextProcessor(DelegateAsyncProcessor).process(Exchange,
> AsyncCallback) line: 90
>         DefaultChannel.process(Exchange, AsyncCallback) line: 335
>         AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
> 73
>         Pipeline.process(Exchange, Exchange, AsyncCallback, Iterator<Processor>,
> AsyncProcessor) line: 117
>         Pipeline.process(Exchange, AsyncCallback) line: 80
>         RouteContextProcessor.processNext(Exchange, AsyncCallback) line: 46
>         RouteContextProcessor(DelegateAsyncProcessor).process(Exchange,
> AsyncCallback) line: 90
>         UnitOfWorkProcessor.processAsync(Exchange, AsyncCallback, UnitOfWork) line:
> 150
>         UnitOfWorkProcessor.process(Exchange, AsyncCallback) line: 117
>         RouteInflightRepositoryProcessor.processNext(Exchange, AsyncCallback) line:
> 48
>         RouteInflightRepositoryProcessor(DelegateAsyncProcessor).process(Exchange,
> AsyncCallback) line: 90
>         AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
> 73
>         InstrumentationProcessor(DelegateAsyncProcessor).processNext(Exchange,
> AsyncCallback) line: 99
>         InstrumentationProcessor(DelegateAsyncProcessor).process(Exchange,
> AsyncCallback) line: 90
>         InstrumentationProcessor.process(Exchange, AsyncCallback) line: 72
>         AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
> 73
>         SedaConsumer.sendToConsumers(Exchange) line: 275
>         SedaConsumer.doRun() line: 183
>         SedaConsumer.run() line: 139
>
> RejectableThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker)
> line: 1110
>         ThreadPoolExecutor$Worker.run() line: 603
>         Thread.run() line: 636
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Graceful-shutdown-not-working-tp5733697p5733763.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Graceful shutdown not working

Posted by miljenko <mi...@2e-systems.com>.
I've tested with versions 2.10.3 and 2.11.0.

This is just a short example that can reproduce described problem. You can
put anything else in the splitter, it will not be reached.

Reducing unnecessary code showed that example worked if "seda" was replaced
with "direct" or "maximumRedeliveries" removed, so I guess problem is
somehow related to that.

Here is stack trace after it got stucked (I've paused the thread):

Daemon Thread [Camel (camel-1) thread #0 - seda://queue1] (Suspended)	
	DefaultCamelContext.getErrorHandlerExecutorService() line: 1321	
	DeadLetterChannel(RedeliveryErrorHandler).doStart() line: 1131	
	DeadLetterChannel(ChildServiceSupport).start(boolean) line: 41	
	DeadLetterChannel(ChildServiceSupport).start() line: 28	
	ServiceHelper.startService(Service) line: 64	
	ServiceHelper.startService(Object) line: 54	
	ServiceHelper.startServices(Object...) line: 75	
	RouteContextProcessor(DelegateAsyncProcessor).doStart() line: 78	
	RouteContextProcessor(ServiceSupport).start() line: 61	
	ServiceHelper.startService(Service) line: 64	
	ServiceHelper.startService(Object) line: 54	
	ServiceHelper.startServices(Object...) line: 75	
	UnitOfWorkProcessor(DelegateAsyncProcessor).doStart() line: 78	
	UnitOfWorkProcessor.doStart() line: 88	
	UnitOfWorkProcessor(ServiceSupport).start() line: 61	
	ServiceHelper.startService(Service) line: 64	
	ServiceHelper.startService(Object) line: 54	
	ServiceHelper.startServices(Object...) line: 75	
	Splitter(MulticastProcessor).createErrorHandler(RouteContext, Exchange,
Processor) line: 876	
	Splitter(MulticastProcessor).createProcessorExchangePair(int, Processor,
Exchange, RouteContext) line: 833	
	Splitter$1$1.next() line: 178	
	Splitter$1$1.next() line: 133	
	Splitter.createProcessorExchangePairsList(Exchange, Object) line: 195	
	Splitter.createProcessorExchangePairs(Exchange) line: 113	
	Splitter(MulticastProcessor).process(Exchange, AsyncCallback) line: 206	
	Splitter.process(Exchange, AsyncCallback) line: 98	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
73	
	BacklogTracerInterceptor(DelegateAsyncProcessor).processNext(Exchange,
AsyncCallback) line: 99	
	BacklogTracerInterceptor(DelegateAsyncProcessor).process(Exchange,
AsyncCallback) line: 90	
	BacklogTracerInterceptor.process(Exchange, AsyncCallback) line: 84	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
73	
	TraceInterceptor(DelegateAsyncProcessor).processNext(Exchange,
AsyncCallback) line: 99	
	TraceInterceptor(DelegateAsyncProcessor).process(Exchange, AsyncCallback)
line: 90	
	TraceInterceptor.process(Exchange, AsyncCallback) line: 163	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
73	
	DeadLetterChannel(RedeliveryErrorHandler).processErrorHandler(Exchange,
AsyncCallback, RedeliveryErrorHandler$RedeliveryData) line: 390	
	DeadLetterChannel(RedeliveryErrorHandler).process(Exchange, AsyncCallback)
line: 273	
	RouteContextProcessor.processNext(Exchange, AsyncCallback) line: 46	
	RouteContextProcessor(DelegateAsyncProcessor).process(Exchange,
AsyncCallback) line: 90	
	DefaultChannel.process(Exchange, AsyncCallback) line: 335	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
73	
	Pipeline.process(Exchange, Exchange, AsyncCallback, Iterator<Processor>,
AsyncProcessor) line: 117	
	Pipeline.process(Exchange, AsyncCallback) line: 80	
	RouteContextProcessor.processNext(Exchange, AsyncCallback) line: 46	
	RouteContextProcessor(DelegateAsyncProcessor).process(Exchange,
AsyncCallback) line: 90	
	UnitOfWorkProcessor.processAsync(Exchange, AsyncCallback, UnitOfWork) line:
150	
	UnitOfWorkProcessor.process(Exchange, AsyncCallback) line: 117	
	RouteInflightRepositoryProcessor.processNext(Exchange, AsyncCallback) line:
48	
	RouteInflightRepositoryProcessor(DelegateAsyncProcessor).process(Exchange,
AsyncCallback) line: 90	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
73	
	InstrumentationProcessor(DelegateAsyncProcessor).processNext(Exchange,
AsyncCallback) line: 99	
	InstrumentationProcessor(DelegateAsyncProcessor).process(Exchange,
AsyncCallback) line: 90	
	InstrumentationProcessor.process(Exchange, AsyncCallback) line: 72	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line:
73	
	SedaConsumer.sendToConsumers(Exchange) line: 275	
	SedaConsumer.doRun() line: 183	
	SedaConsumer.run() line: 139	

RejectableThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker)
line: 1110	
	ThreadPoolExecutor$Worker.run() line: 603	
	Thread.run() line: 636	




--
View this message in context: http://camel.465427.n5.nabble.com/Graceful-shutdown-not-working-tp5733697p5733763.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Graceful shutdown not working

Posted by Claus Ibsen <cl...@gmail.com>.
Sounds a bit odd. If the splitter only logs

What Camel version do you use?


On Mon, Jun 3, 2013 at 3:01 PM, miljenko <mi...@2e-systems.com> wrote:
> Hi,
>
> I've got graceful shutdown issue that can be reproduced with this route:
>
>
>                 errorHandler(deadLetterChannel("direct:queue2")
>                         .maximumRedeliveries(1)
>                 );
>
>                 from("seda:queue1")
>                 .log("Checkpoint 1")
>                 .split(body())
>                     .log("Checkpoint 2")
>                 .end()
>                 .log("Checkpoint 3");
>
>
>                 from("direct:queue2")
>                 .log("Checkpoint 4");
>
>
> If ".maximumRedeliveries(1)" is commented out, it works as expected, but
> with this line, message stays in flight and "Checkpoint 2" is never reached.
>
> Is this a Camel bug, if not, how can it be fixed?
>
> Best regards,
> Miljenko
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Graceful-shutdown-not-working-tp5733697.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen