arturobernalg commented on code in PR #809:
URL: 
https://github.com/apache/httpcomponents-client/pull/809#discussion_r2891452748


##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java:
##########
@@ -388,8 +389,20 @@ public ConnectionEndpoint get(
                     final PoolEntry<HttpRoute, ManagedHttpClientConnection> 
poolEntry;
                     try {
                         poolEntry = leaseFuture.get(timeout.getDuration(), 
timeout.getTimeUnit());
-                    } catch (final TimeoutException ex) {
-                        leaseFuture.cancel(true);
+                    } catch (final TimeoutException | InterruptedException ex) 
{
+                        if (!leaseFuture.cancel(true)) {
+                            try {
+                                final PoolEntry<HttpRoute, 
ManagedHttpClientConnection> latePoolEntry = leaseFuture.get(

Review Comment:
   @ok2c  I dropped the second get() and reworked it to use the pool.lease(..., 
FutureCallback) to capture late completions and release the PoolEntry on 
timeout/interrupt/cancel.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to