ok2c commented on a change in pull request #277:
URL: 
https://github.com/apache/httpcomponents-core/pull/277#discussion_r605118768



##########
File path: httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
##########
@@ -172,7 +175,20 @@ public void close() {
         Args.notNull(requestTimeout, "Request timeout");
         Asserts.check(!this.isShutDown.get(), "Connection pool shut down");
         final Deadline deadline = Deadline.calculate(requestTimeout);
-        final BasicFuture<PoolEntry<T, C>> future = new 
BasicFuture<>(callback);
+        final BasicFuture<PoolEntry<T, C>> future = new 
BasicFuture<PoolEntry<T, C>>(callback) {
+
+            @Override
+            public synchronized PoolEntry<T, C> get(
+                    final long timeout, final TimeUnit unit) throws 
InterruptedException, ExecutionException, TimeoutException {
+                try {
+                    return super.get(timeout, unit);
+                } catch (final TimeoutException ex) {
+                    cancel();
+                    throw ex;
+                }
+            }
+
+        };

Review comment:
       @garydgregory Maybe it could. I personally am not crazy about re-use at 
all cost. I consider tight coupling a greater evil. For two occurrences I 
generally never bother.




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

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