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

   _Claude Code on behalf of Croway_
   
   Follow-up of #27145 
([CAMEL-25197](https://issues.apache.org/jira/browse/CAMEL-25197)).
   
   ## Problem
   
   `LocalCliConnector.sigterm()` (the `stop` action of the Camel CLI connector, 
used by `camel stop` and by the websocket transport) runs the termination on an 
`Executors.newSingleThreadExecutor` that is never shut down. Its thread 
(`Terminate JVM task`) is not a daemon: once Camel is stopped it keeps waiting 
for more tasks, and keeps the JVM running.
   
   Camel Main exits on its own, which hid it. A Spring Boot web application did 
not exit after the `stop` action: a thread dump of the lingering process showed 
`Terminate JVM task` as the only non-daemon thread left.
   
   ## Change
   
   - Shut the executor down right after submitting the task, so its thread ends 
once the task is done.
   - `LocalCliConnectorSigtermTest`: after `sigterm()`, Camel is stopped and no 
`Terminate JVM task` thread is left (fails without the change).
   
   ## Tests
   
   - `mvn verify` in `dsl/camel-cli-connector`: 25 tests, 0 failures.
   - Soak test with Camel Spring Boot applications (websocket transport, 240 
s): all applications exit about 1 s after the `stop` action with this change, 
none did without it.
   


-- 
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