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 2022/08/19 12:09:10 UTC

[httpcomponents-client] branch master updated: HTTPCLIENT-2231: a race condition in the main async exec when the request execution on an I/O thread is faster then execution pipeline management on the client thread

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3fe6a8bcd HTTPCLIENT-2231: a race condition in the main async exec when the request execution on an I/O thread is faster then execution pipeline management on the client thread
3fe6a8bcd is described below

commit 3fe6a8bcdf0f49003290efea557ce650f2f41aac
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Aug 17 18:39:05 2022 +0200

    HTTPCLIENT-2231: a race condition in the main async exec when the request execution on an I/O thread is faster then execution pipeline management on the client thread
---
 .../apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
index 3e904342b..86eff6164 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncMainClientExec.java
@@ -133,7 +133,9 @@ class HttpAsyncMainClientExec implements AsyncExecChainHandler {
 
             @Override
             public void cancel() {
-                failed(new InterruptedIOException());
+                if (messageCountDown.get() > 0) {
+                    failed(new InterruptedIOException());
+                }
             }
 
             @Override