davsclaus opened a new pull request, #27599:
URL: https://github.com/apache/camel/pull/27599

   https://issues.apache.org/jira/browse/CAMEL-25484
   
   Follow-up of CAMEL-25365. When a route stop or a dev mode reload times out 
its graceful shutdown, an in-flight exchange is cut off with 
`RejectedExecutionException: The exchange cannot continue: its route is being 
stopped or reloaded`. The error handler logged that as a failed delivery:
   
   ```
   ERROR DefaultErrorHandler : Failed delivery for (MessageId: ...) at 
picked-lines[log2] aggregator.camel.yaml:23. Exhausted after delivery attempt: 
1 caught: java.util.concurrent.RejectedExecutionException: ...
   Message History ...
   Stacktrace ...
   ```
   
   Nothing in the route failed, and a file consumer rolls the file back and 
delivers it again after the reload, but every such save in `camel run --dev` 
printed ERROR blocks. In the local-model benchmark this happened after the last 
save of route-aggregator in 5 of 5 runs: the model had saved an in-between 
version that sent to `direct:shipment` before the route consuming it existed; 
the next reload waited out the graceful timeout and cut the waiting exchange 
off. The step was scored as failed although its final state was right.
   
   Now both error handler tasks (`SimpleTask` and `RedeliveryTask`) log it as 
one line, at most WARN (a lower configured level is kept):
   
   ```
   WARN DefaultErrorHandler : Exchange cut off (MessageId: ... on ExchangeId: 
...) at slow: its route is being stopped or reloaded, so it is not continued. A 
consumer that rolls back, such as file, delivers it again
   ```
   
   - Detected by the reason of CAMEL-25365, so a forced CamelContext stop (its 
own reason) and every other failure are logged as before.
   - The exception set on the exchange is unchanged, so `onException` and 
consumers see the same.
   - Upgrade guide 4.23 note (ERROR becomes WARN for this case).
   
   Tests: `RouteStopCutOffLogTest` reproduces it (split, `direct:` without a 
consumer, route stop with a 1 s timeout; it failed with the old ERROR before 
the change). camel-core error handler, redelivery, dead letter, shutdown and 
reload tests pass (196 tests).
   
   🤖 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]

Reply via email to