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

   Following up on the last two reviews.
   
   **IdleConnectionEvictor side effect (14:20 review):** Already addressed in 
[bc6727ba808c](https://github.com/apache/camel/pull/30505/commits/bc6727ba808c20b04329446839c11a68ab71f9)
 — the configurer sets `connManagerShared=true`, builds the token client, then 
immediately resets `connManagerShared=false`. The endpoint's own client, built 
from the same builder after all configurers have run 
(`HttpEndpoint.createHttpClient()`), sees `false` and starts the 
`IdleConnectionEvictor` normally.
   
   **JIRA reproducer — test evidence:**
   
   I ran the two tests against the unfixed code (reverting 
`OAuth2ClientConfigurer.configureHttpClient` to the original one-liner):
   
   - `tokenClientCloseDoesNotShutDownEndpointPool`: **fails** with 
`IllegalStateException: Connection pool shut down` on all three Surefire 
attempts without the fix, **passes** with it.
   - `tokenAndApiOnSameHostSucceeds`: **passes** without the fix.
   
   This confirms your earlier reading: the end-to-end test does not reproduce 
the JIRA trigger. The JIRA log shows the pool is shut down during 
`HttpRequestRetryExec`'s retry of the first exchange, not during a stop/restart 
cycle.
   
   **Where the pool actually gets closed:**
   
   The JIRA stack has the pool closed while `StrictConnPool.lease()` is called 
from `HttpRequestRetryExec`, which means the pool was shut down *between* the 
initial attempt and the retry. During that window, the only code that runs is 
the retry path in `HttpRequestRetryExec` and anything triggered by releasing 
the failed connection. The token request completes before the SocketException 
(the JIRA log shows the token was fetched — the error is on the API call). I 
don't yet have a theory for what triggers `pool.close()` during the retry path 
without a configurer stop. If you can point me at the exact stack frame in the 
JIRA comments that closes the pool, or if running the YAML reproducer against 
this branch vs. main makes the difference clear, that would help narrow it down.
   
   The dual-ownership fix is correct regardless: a connection manager must have 
exactly one owner, and before this fix both clients considered themselves its 
owner.
   
   _Claude Sonnet 4.6 on behalf of gnodet_


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