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


##########
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:
   @arturobernalg This hardly looks any better to me. I like @benjaminp 
approach better (other than the exception handling part) but I would try to 
push the fix into PoolingHttpClientConnectionManager or possibly even into 
core. 
   
   I will try to look into it on the weekend



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