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 2025/08/30 17:23:06 UTC

(httpcomponents-core) branch master updated (be71c3aab -> c5d707c77)

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

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


    from be71c3aab HTTP/1.1 async protocol handler to read message data more greedily
     new c334a3e53 ClassicToAsyncResponseConsumer to ensure the latch has been released when releasing resources
     new a099f9c6a Bug fix: corrected exception propagation by BasicClientExchangeHandler in case of abnormal / premature exchange termination
     new c5d707c77 Classic to async facade to propagate ConnectionClosedException to the caller

The 3 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:
 .../hc/core5/http/nio/support/BasicClientExchangeHandler.java       | 6 ++++--
 .../http/nio/support/classic/ClassicToAsyncResponseConsumer.java    | 3 +++
 .../hc/core5/http/nio/support/classic/ClassicToAsyncSupport.java    | 3 +++
 3 files changed, 10 insertions(+), 2 deletions(-)


(httpcomponents-core) 01/03: ClassicToAsyncResponseConsumer to ensure the latch has been released when releasing resources

Posted by ol...@apache.org.
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-core.git

commit c334a3e537bdd1fba4efce5eef38e83349583659
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Aug 30 14:26:56 2025 +0200

    ClassicToAsyncResponseConsumer to ensure the latch has been released when releasing resources
---
 .../core5/http/nio/support/classic/ClassicToAsyncResponseConsumer.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncResponseConsumer.java b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncResponseConsumer.java
index 8c33f7862..179eabf21 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncResponseConsumer.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncResponseConsumer.java
@@ -186,6 +186,9 @@ public final void failed(final Exception cause) {
 
     @Override
     public void releaseResources() {
+        if (countDownLatch.getCount() > 0) {
+            countDownLatch.countDown();
+        }
     }
 
     class InternalInputStream extends InputStream {


(httpcomponents-core) 02/03: Bug fix: corrected exception propagation by BasicClientExchangeHandler in case of abnormal / premature exchange termination

Posted by ol...@apache.org.
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-core.git

commit a099f9c6ac4fe0a409dbd87499c71c90f332e336
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Aug 30 14:25:40 2025 +0200

    Bug fix: corrected exception propagation by BasicClientExchangeHandler in case of abnormal / premature exchange termination
---
 .../hc/core5/http/nio/support/BasicClientExchangeHandler.java       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/BasicClientExchangeHandler.java b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/BasicClientExchangeHandler.java
index 0378a98d7..c74b7d319 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/BasicClientExchangeHandler.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/BasicClientExchangeHandler.java
@@ -147,11 +147,13 @@ public void streamEnd(final List<? extends Header> trailers) throws HttpExceptio
     @Override
     public void failed(final Exception cause) {
         try {
-            if (inputTerminated.get()) {
+            if (inputTerminated.compareAndSet(false, true)) {
                 responseConsumer.failed(cause);
+                responseConsumer.releaseResources();
             }
-            if (!outputTerminated.get()) {
+            if (outputTerminated.compareAndSet(false, true)) {
                 requestProducer.failed(cause);
+                requestProducer.releaseResources();
             }
         } finally {
             failedInternal(cause);


(httpcomponents-core) 03/03: Classic to async facade to propagate ConnectionClosedException to the caller

Posted by ol...@apache.org.
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-core.git

commit c5d707c7779af7bb920fcdc9b25995bb249010bf
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Aug 30 19:15:04 2025 +0200

    Classic to async facade to propagate ConnectionClosedException to the caller
---
 .../hc/core5/http/nio/support/classic/ClassicToAsyncSupport.java       | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncSupport.java b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncSupport.java
index 501edee11..30b0fa696 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncSupport.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/classic/ClassicToAsyncSupport.java
@@ -29,6 +29,7 @@
 
 import java.io.IOException;
 
+import org.apache.hc.core5.http.ConnectionClosedException;
 import org.apache.hc.core5.http.HttpException;
 
 final class ClassicToAsyncSupport {
@@ -40,6 +41,8 @@ static void rethrow(final Throwable ex) throws IOException {
             throw (Error) ex;
         } else if (ex instanceof RuntimeException) {
             throw (RuntimeException) ex;
+        } else if (ex instanceof ConnectionClosedException) {
+            throw (ConnectionClosedException) ex;
         } else if (ex instanceof IOException) {
             throw new TransportException((IOException) ex);
         } else if (ex instanceof HttpException) {