You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2023/07/04 13:15:36 UTC

[httpcomponents-core] branch HTTPCORE-754 updated (277370dd8 -> da565a8f8)

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a change to branch HTTPCORE-754
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git


 discard 277370dd8 HTTPCORE-754: StrictConnPool fails to correctly handle infinite request timeout
     new da565a8f8 HTTPCORE-754: StrictConnPool fails to correctly handle infinite request timeout

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (277370dd8)
            \
             N -- N -- N   refs/heads/HTTPCORE-754 (da565a8f8)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[httpcomponents-core] 01/01: HTTPCORE-754: StrictConnPool fails to correctly handle infinite request timeout

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch HTTPCORE-754
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit da565a8f81b46d50a389badb7d4748d48bceec12
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Fri Jun 30 17:45:52 2023 +0200

    HTTPCORE-754: StrictConnPool fails to correctly handle infinite request timeout
---
 .../src/main/java/org/apache/hc/core5/pool/StrictConnPool.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java b/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
index 9801cf82e..0ac5faca3 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/pool/StrictConnPool.java
@@ -192,7 +192,12 @@ public class StrictConnPool<T, C extends ModalCloseable> implements ManagedConnP
         final boolean acquiredLock;
 
         try {
-            acquiredLock = this.lock.tryLock(requestTimeout.getDuration(), requestTimeout.getTimeUnit());
+            if (Timeout.isPositive(requestTimeout)) {
+                acquiredLock = this.lock.tryLock(requestTimeout.getDuration(), requestTimeout.getTimeUnit());
+            } else {
+                this.lock.lockInterruptibly();
+                acquiredLock = true;
+            }
         } catch (final InterruptedException interruptedException) {
             Thread.currentThread().interrupt();
             future.cancel();