You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jh. To. (Jira)" <ji...@apache.org> on 2020/07/02 19:38:00 UTC

[jira] [Commented] (CAMEL-15245) On route shutdown timeout DefaultShutdownStrategy.forceShutdown remains set to true

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

Jh. To. commented on CAMEL-15245:
---------------------------------

The issue happens when the graceful shutdown times out, at that point it seems the forceShutdown flag is set at that point. Nevertheless I think you are right, calling only stopRoute is working properly for me so there is actually no need to call 

{code:bash}
camelContext.getShutdownStrategy().shutdown(camelContext, filteredRoutes)
{code}

to shutdown my routes. My understanding was that this shutdown API would shutdown only the provided filteredRoutes. As far as I saw it does however the context-level forceShutdown variable seems to be set to true when the forceful shutdown is forced and not reset back to false, yielding to the issue described in the issue.

From my perspective is not an issue anymore since my code is working now properly by using stopRoute instead. Not sure however if this is still an issue for someone else trying to stop routes using the shutdown strategy shutdown method.

> On route shutdown timeout DefaultShutdownStrategy.forceShutdown remains set to true
> -----------------------------------------------------------------------------------
>
>                 Key: CAMEL-15245
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15245
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>         Environment: Linux Ubuntu 5.7.4-050704-generic #202006181331 SMP Thu Jun 18 13:33:57 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Jh. To.
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.5.0
>
>
> I see the following behavior with the default shutdown strategy: when the graceful shutdown of a route times-out, a forced shutdow is executed by Camel. The following is logged in this case:
> {code:bash}
> 2020-06-25 14:59:57,640 INFO  http-nio-127.0.0.1-9080-exec-10 [] [] org.apache.camel.impl.engine.DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 10 seconds)
> 2020-06-25 15:00:07,647 WARN  http-nio-127.0.0.1-9080-exec-10 [] [] org.apache.camel.impl.engine.DefaultShutdownStrategy - Timeout occurred during graceful shutdown. Forcing the routes to be shutdown now. Notice: some resources may still be running as graceful shutdown did not complete successfully.
> {code}
> After the forced shutdown succeeds the following is logged
> {code:bash}
> 2020-06-25 15:00:08,711 INFO  http-nio-127.0.0.1-9080-exec-10 [] [] org.apache.camel.impl.engine.DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 11 seconds
> {code}
> After the starting the route however the default shutdown strategy from the camel context has the forceShutdown flag set to true, causing the execution of the route to fail as follows:
> {code:bash}
> Caused by: java.util.concurrent.RejectedExecutionException: Run not allowed as ShutdownStrategy is forcing shutting down, will reject executing exchange: Exchange[]
> 	at org.apache.camel.processor.SharedCamelInternalProcessor.continueProcessing(SharedCamelInternalProcessor.java:310) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:145) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.processor.SharedCamelInternalProcessor$1.process(SharedCamelInternalProcessor.java:110) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.processor.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:107) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.impl.engine.DefaultProducerCache.send(DefaultProducerCache.java:185) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:153) ~[camel-base-3.4.0.jar:3.4.0]
> 	at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:295) ~[camel-base-3.4.0.jar:3.4.0]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)