davsclaus opened a new pull request, #27401: URL: https://github.com/apache/camel/pull/27401
https://issues.apache.org/jira/browse/CAMEL-25365 In dev mode, a route edit that adds `to: direct:shipment` together with the route consuming `direct:shipment` reloads while an exchange waits for that consumer. The reload's graceful shutdown waits for the exchange (5 s), then forces the shutdown. In the log, a user saw this: ``` INFO DefaultShutdownStrategy : Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 5 seconds. Inflights per route: [picked-lines = 1] ... (once a second) WARN DefaultShutdownStrategy : Timeout occurred during graceful shutdown. Forcing the routes to be shutdown now. ... WARN TimerConsumer : Error processing exchange. Exchange[...]. Caused by: [java.util.concurrent.RejectedExecutionException - null] ``` Nothing said where the exchange waited, and the exception with no message looks like a fault in the route. The dev profile turns the verbose in-flight listing off (`shutdownLogInflightExchangesOnTimeout=false`), so even that did not show. Now, from `camel run --dev` on the same edit: ``` INFO DefaultShutdownStrategy : Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 5 seconds. Inflights per route: [picked-lines = 1]. Waiting at: picked-lines/to1 (app.camel.yaml:10) WARN TimerConsumer : Error processing exchange. Exchange[...]. Caused by: [java.util.concurrent.RejectedExecutionException - The exchange cannot continue: its route is being stopped or reloaded] ``` ## Changes - **`DefaultShutdownStrategy`**: when the verbose listing is off and the inflight repository can be browsed, the one-line wait message names where the exchanges are: route, node and source line, at most three places. - **`RedeliveryErrorHandler`**: the two `RejectedExecutionException`s created when an exchange cannot go on get a message. One is for a route that is stopping or reloading; the other is for a forced shutdown after the graceful one timed out. The exception type is unchanged. - **`DirectProducer`**: interrupted while waiting for a consumer (`block=true`), it logs that, names the endpoint, and fails the exchange with a `DirectConsumerNotAvailableException`, not a bare `InterruptedException`. ## Found in the local-model benchmark In the r5 run of the local-model benchmark, route-aggregator step 1 hit this in 3 of 5 runs: the model added the `to: direct:shipment` and the aggregator route in one edit. A person editing a route in dev mode hits the same thing. Tests: `ShutdownWaitingAtTest` (3). camel-core suite: 8073 tests. Two file-consumer tests failed in the full run (`FileConsumerIdempotentKeyNameAndSizeTest`, `PollEnrichFileDefaultAggregationStrategyTest`); both pass in 3 of 3 runs on their own. 🤖 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]
