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 2021/12/23 16:39:00 UTC

[jira] [Commented] (CAMEL-17374) RecepientList doesnt stop after CamelContext.shutdown()

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

Claus Ibsen commented on CAMEL-17374:
-------------------------------------

What Camel version do you use, and can you show a improved example what you do and how to reproduce this.

A shutdown is never guaranteed to terminate all threads as they can be inflight and controlled by 3rd party systems. And when you shutdown Camel you often shutdown the JVM and then those threads of course die. So why after shutting down Camel do you keep the JVM running?

> RecepientList doesnt stop after CamelContext.shutdown()
> -------------------------------------------------------
>
>                 Key: CAMEL-17374
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17374
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Stepan Shcherbakov
>            Priority: Major
>
> My program has camel route:
> timer -> direct:send:to:recipientList
> direct:send:to:recipientList -> recipientList -> direct1
>                                                                     -> direct2
> direct1 -> processor -> file
> direct2 -> processor -> http (which fails with error)
> *redelivery set to infinite (-1) and redelivery delay set to 100ms*
> I called CamelContext.shutdown() and it shutdowned successful.
> Suddenly, after 30s from shutdown was completed, 3 recipientList processors raised and started to redelivery:
> 2021/12/23-13:40:35.265 [Camel (ContextName) thread #10 - RecipientList](463) W! org.apache.camel.processor.errorhandler.RedeliveryErrorHandler - Error during processing OnExceptionOccurred. This exception is ignored.
> java.lang.IllegalArgumentException: my exception 
> at my error handler
> at chassis//org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.onExceptionOccurred(RedeliveryErrorHandler.java:953) at chassis//org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:635) at chassis//org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:623) at chassis//org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) at chassis//org.apache.camel.impl.engine.DefaultReactiveExecutor.schedule(DefaultReactiveExecutor.java:55) at chassis//org.apache.camel.processor.MulticastProcessor.lambda$schedule$1(MulticastProcessor.java:312) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)
> Exception from error handler is ok because I throw it when camel context is stopped.
> *Why there are working camel threads after context was shutdowned?*
> These threads never stop and trying to redelivery every 100ms (as redelivery delay set).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)