Claus Ibsen created CAMEL-25365:
-----------------------------------

             Summary: camel-core - a dev mode reload that cuts off in-flight 
exchanges says where they were waiting, and does not log them as unexplained 
errors
                 Key: CAMEL-25365
                 URL: https://issues.apache.org/jira/browse/CAMEL-25365
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: Claus Ibsen


In dev mode a route file is reloaded while messages are in flight. When the 
in-flight exchanges are blocked, for example on a {{direct:}} endpoint whose 
consumer is part of the same edit, the reload waits for the graceful shutdown 
timeout, forces the shutdown, and the interrupted exchanges are logged as 
errors:

{noformat}INFO  DefaultShutdownStrategy : Waiting as there are still 2 inflight 
and pending exchanges to complete, timeout in 5 seconds. Inflights per route: 
[picked-lines = 2]
... (once per second)
WARN  DefaultShutdownStrategy : Timeout occurred during graceful shutdown. 
Forcing the routes to be shutdown now. ...
INFO  DirectProducer : Interrupted while processing the exchange
ERROR DefaultErrorHandler : Failed delivery for (...) at picked-lines[log2] 
aggregator.camel.yaml:23. Exhausted after delivery attempt: 1 caught: 
java.util.concurrent.RejectedExecutionException{noformat}

Nothing in the log says what the exchanges were waiting on, and the ERROR with 
a RejectedExecutionException looks like a bug in the route, while it is the 
reload cutting them off. Found in the local-model benchmark (r5, 
route-aggregator step 1: the model added {{to: direct:shipment}} and the 
aggregator route that consumes it; 3 of 5 runs logged the errors). A person 
editing a route in dev mode meets the same thing.

Proposals, to be weighed:
* The shutdown wait message names where the in-flight exchanges are, for 
example the endpoint or processor they are blocked in ("waiting at 
direct:shipment").
* An exchange that the reload's forced shutdown interrupts is logged as a WARN 
that says so ("interrupted by the route reload"), not as an unexplained ERROR 
with a RejectedExecutionException.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to