[ 
https://issues.apache.org/jira/browse/CAMEL-26427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-26427.
---------------------------------
    Resolution: Fixed

Fixed by #28762 ([https://github.com/apache/camel/pull/28762]).

_Claude Code on behalf of davsclaus (Claus Ibsen)_

> camel-jbang - Every CLI command waits 300 ms before the JVM exits
> -----------------------------------------------------------------
>
>                 Key: CAMEL-26427
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26427
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> Every command of the Camel CLI ({{camel version}}, {{camel ps}}, {{camel 
> --help}}, ...) waits about 300 ms in the exit of the JVM.
> {{Harden}} creates a JDK {{HttpClient}} in a field initializer, and the CLI 
> creates all its commands at startup, so every run starts the selector thread 
> of that client. The thread is in native code ({{KQueue.poll}} / {{epoll}}) 
> when the JVM exits, and HotSpot waits up to 300 ms for threads in native code 
> before it exits.
> Measured on main, JDK 25: {{camel version}} 920 ms wall, of which 310 ms 
> after {{System.exit}}; with the client created on first use, 5 ms after 
> {{System.exit}} and 566 ms wall.
> Found while measuring the startup for CAMEL-23810.
> _Claude Code on behalf of davsclaus (Claus Ibsen)_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to