ffang commented on code in PR #3725:
URL: https://github.com/apache/cxf/pull/3725#discussion_r4606079987


##########
rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitFactory.java:
##########
@@ -144,7 +143,8 @@ public PoolingAsyncClientConnectionManager 
getConnectionManager() {
         }
     }
 
-    private volatile Map<HTTPClientPolicy, AsyncClient> clients = new 
ConcurrentHashMap<>();
+    // the clients of the conduits, to shut them down with the factory
+    private final Map<CloseableHttpAsyncClient, AsyncClient> clients = new 
ConcurrentHashMap<>();

Review Comment:
   Thanks @reta, you're right, the set is enough: done in da7c7cbfc9. The 
factory keeps a `Set<AsyncClient>`, `createClient()` still returns the 
`CloseableHttpAsyncClient`, and `release()` looks it up:
   
   clients.stream().filter(c -> c.getClient() == 
httpClient).findAny().ifPresent(this::release);
   
   The private `release(AsyncClient)` shuts the client down only if 
`clients.remove()` succeeds, so a conduit's `close()` racing with the bus 
shutdown still shuts it down once.



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