davsclaus opened a new pull request, #27632: URL: https://github.com/apache/camel/pull/27632
[CAMEL-25500](https://issues.apache.org/jira/browse/CAMEL-25500) `stopAllRoutes()` and `removeAllRoutes()` (which the route reload in dev mode calls on every reload) stopped the routes one at a time, each as its own graceful shutdown. The ShutdownStrategy keeps a downstream route running until the upstream routes have drained (`DirectConsumer.deferShutdown`), but only within one batch. One by one, the downstream route stopped as soon as its own inflight count was 0, a split upstream then blocked on the direct endpoint, and its exchanges were cut off at the shutdown timeout. Now all the running routes are stopped as one batch through the ShutdownStrategy, as when the CamelContext stops (the same pattern as `doShutdownRouteGroup`), then their route services are stopped. Measured with a split sending 4 lines to a direct route, stopped partway: | | time | delivered | |---|---|---| | before | the full shutdown timeout | 1 of 4 | | after | ~1 s | 4 of 4 | The shutdown timeout now applies to all routes together instead of to each route in turn (noted in the 4.23 upgrade guide). Found in the local-model benchmark (route-aggregator example), related to CAMEL-25484. Tests: - `StopAllRoutesDrainTest` (new): `removeAllRoutes` and `stopAllRoutes` deliver all split lines; both fail without the fix. - camel-core full suite: green (one file-consumer timing test, `FileConsumerFailureHandledTest.testDublin`, failed once and passed on rerun). - camel-base-engine and camel-main suites: green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
