ffang commented on code in PR #3673:
URL: https://github.com/apache/cxf/pull/3673#discussion_r4498447544
##########
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpClientHTTPConduit.java:
##########
@@ -470,10 +584,16 @@ protected void setupConnection(Message message, Address
address, HTTPClientPolic
initializationLock.lock();
try {
cl = clientRef;
+ if (cl == null && !httpsReset) {
+ // switching back to the settings of a client this conduit
has used before
+ cl = takeDeferredClient(clientPolicy,
clientParametersCopy);
Review Comment:
Thanks @reta, yes, it's the same point @coheigea raised. A client the
conduit takes back can't be closing:
- The conduit keeps its reference on every client it stops using, and only
releases them in `close()`. The count stays above zero, so the client isn't
shut down, whatever other conduits sharing it do.
- `close()` now collects the current and deferred references under
`initializationLock`, the same lock `takeDeferredClient` runs under. A
concurrent request can't take one back after `close()` has collected them
(67c01db170).
- Clients dropped because the HTTPS address changed, and the ones deferred
before, go to a separate queue and are never taken back. They're only released
on `close()`.
--
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]