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 2021/12/16 19:44:21 UTC

[httpcomponents-client] branch HTTPCLIENT-2192 created (now 7d943d6)

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

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


      at 7d943d6  HTTPCLIENT-2192: Incorrect connection validity check in the async connection manager can cause an IllegalStateException and lead to a connection leak. Treat closed connections as valid due to the connection open check being inherently racy

This branch includes the following new commits:

     new 7d943d6  HTTPCLIENT-2192: Incorrect connection validity check in the async connection manager can cause an IllegalStateException and lead to a connection leak. Treat closed connections as valid due to the connection open check being inherently racy

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.


[httpcomponents-client] 01/01: HTTPCLIENT-2192: Incorrect connection validity check in the async connection manager can cause an IllegalStateException and lead to a connection leak. Treat closed connections as valid due to the connection open check being inherently racy

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

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

commit 7d943d6f99ed0ef0959199c7b14d76ada218a453
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Thu Dec 16 20:40:04 2021 +0100

    HTTPCLIENT-2192: Incorrect connection validity check in the async connection manager can cause an IllegalStateException and lead to a connection leak. Treat closed connections as valid due to the connection open check being inherently racy
---
 .../client5/http/impl/nio/PoolingAsyncClientConnectionManager.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
index b7c609f..32617d6 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConnectionManager.java
@@ -79,7 +79,6 @@ import org.apache.hc.core5.pool.StrictConnPool;
 import org.apache.hc.core5.reactor.Command;
 import org.apache.hc.core5.reactor.ConnectionInitiator;
 import org.apache.hc.core5.util.Args;
-import org.apache.hc.core5.util.Asserts;
 import org.apache.hc.core5.util.Identifiable;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.Timeout;
@@ -545,8 +544,9 @@ public class PoolingAsyncClientConnectionManager implements AsyncClientConnectio
 
         PoolEntry<HttpRoute, ManagedAsyncClientConnection> getValidatedPoolEntry() {
             final PoolEntry<HttpRoute, ManagedAsyncClientConnection> poolEntry = getPoolEntry();
-            final ManagedAsyncClientConnection connection = poolEntry.getConnection();
-            Asserts.check(connection != null && connection.isOpen(), "Endpoint is not connected");
+            if (poolEntry.getConnection() == null) {
+                throw new ConnectionShutdownException();
+            }
             return poolEntry;
         }