gnodet commented on PR #30505:
URL: https://github.com/apache/camel/pull/30505#issuecomment-7102371137

   Thanks again for the continued scrutiny, @davsclaus.
   
   **Javadoc update (latest commit)**
   
   Updated the class Javadoc to remove the "regression test" framing and to 
explain precisely what the two tests cover:
   - `tokenAndApiOnSameHostSucceeds` — end-to-end sanity check for the 
same-host scenario; does not reproduce the JIRA failure.
   - `tokenClientCloseDoesNotShutDownEndpointPool` — directly verifies the 
double-ownership invariant by simulating the configurer lifecycle.
   
   The description no longer says "stop/restart cycle shut the pool down" since 
that only holds for the simulated sequence.
   
   **On the YAML reproducer**
   
   You are right that the JIRA failure stack trace shows `Connection pool shut 
down` on the first request of a running route — a lifecycle that 
`tokenAndApiOnSameHostSucceeds` does not trigger. I do not have `camel run` 
available in this environment, so I cannot directly test the YAML route from 
the JIRA.
   
   The fix is nonetheless correct as a preventive measure: without 
`connManagerShared=true`, the token client's `InternalHttpClient` holds a 
reference to the connection manager in its closeables list (see 
[HttpClientBuilder.build()](https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.java)),
 so any close of the token client — however triggered — shuts down the shared 
pool. With the fix, the token client's close is a no-op for the pool, and 
`HttpEndpoint.doStop()` retains exclusive control.
   
   If the JIRA reproducer still fails with this change applied, that would 
point to a separate root cause (not the double-ownership path). I would need a 
stack trace of the caller of `PoolingHttpClientConnectionManager.close()` on 
the failing run to investigate further. If you are able to run `camel run` 
against the YAML reproducer and find it still fails, please share the trace and 
I will continue the investigation.
   
   _Guillaume Nodet_


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