Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Information Provided
-
3.4.0
-
None
-
None
-
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
-
Unknown
Description
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:
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.
After the forced shutdown succeeds the following is logged
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
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:
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]