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

   # Description
   
   [CAMEL-25850](https://issues.apache.org/jira/browse/CAMEL-25850)
   
   With `minThreads` or `maxThreads` on the Jetty component, every Jetty server 
gets a thread pool of its own, but `JettyHttpComponent` kept only the pool of 
the last server it created, in one field, and stopped that pool whenever any 
server was no longer used (`disconnect`, since CAMEL-14137). With servers on 
two ports, stopping the routes of the first port stopped the thread pool of the 
second server, which then accepted no connection while its routes stayed 
started; the pool of the first server was never stopped.
   
   Changes:
   - `ConnectorRef` keeps the thread pool created for its server 
(`ownThreadPool`: only the pool built from `minThreads` / `maxThreads`, never a 
user-supplied `threadPool`).
   - `disconnect` and `doStop` stop that pool together with its server. The 
`defaultQueuedThreadPool` field is gone (a local variable in `createServer`).
   
   No option changed, so no upgrade guide entry.
   
   Tests:
   - New `JettyThreadPoolTwoServersTest` (component with `minThreads=4`, 
`maxThreads=10`, routes on two ports): `stoppingOneServerKeepsTheOtherServing` 
fails without the change (`java.net.ConnectException` on the second port after 
the first route stopped), `stoppingBothServersStopsBothThreadPools` counts the 
threads of the two thread pools of the test's servers (by pool name, as other 
test classes of the module run in parallel) and fails without the change 
(`expected: <0> but was: <4>`: the 4 threads of the pool that was never 
stopped). Both pass with the change.
   - camel-jetty unit tests with the change: 410 run, 23 skipped, 1 error in 
`JettyXsltHttpTemplateTest`, which fails the same way without the change in my 
environment (it loads a stylesheet over http from 0.0.0.0).
   
   How it was found: variant analysis of CAMEL-25846 (a resource that belongs 
to one owner kept where another owner finds and stops it), then the JUnit tests.
   
   What was not run: the full root build.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it): 
[CAMEL-25850](https://issues.apache.org/jira/browse/CAMEL-25850).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
     (I built and tested camel-jetty-common and camel-jetty. No option changed. 
I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit 
carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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