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


##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/PoolingHttpClientConnectionManager.java:
##########
@@ -323,7 +323,7 @@ public synchronized ConnectionEndpoint get(
                         final TimeValue timeToLive = 
connectionConfig.getTimeToLive();
                         if (TimeValue.isNonNegative(timeToLive)) {
                             final Deadline deadline = 
Deadline.calculate(poolEntry.getCreated(), timeToLive);
-                            if (deadline.isExpired()) {
+                            if (timeValue.getDuration() == 0 || 
deadline.isExpired()) {

Review Comment:
   @ChristophKaser 
   1. What is the point of calculating the deadline if it is not going be used? 
This looks wrong. Please refactor the code to avoid unnecessary deadline 
calculation. There are various ways of accomplishing that
   2. Please make symmetric changes to the `PoolingAsyncClientConnectionManager`
   3. Please make sure that the build does not fail



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