hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1658693 - in /httpcomponents/httpasyncclient/branches/4.0.x: ./ httpasyncclient/src/main/java/org/apache/http/impl/nio/client/ httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/
Date Tue, 10 Feb 2015 12:07:52 GMT
Author: olegk
Date: Tue Feb 10 12:07:51 2015
New Revision: 1658693

URL: http://svn.apache.org/r1658693
Log:
HTTPASYNC-86: fixed a race condition upon connection lease from the connection pool: in very
rare  circumstances the main execution thread can get jammed for so long that the I/O dispatch
thread succeeds in completing the request and releasing the connection while the main still
is performing connection validation

Modified:
    httpcomponents/httpasyncclient/branches/4.0.x/RELEASE_NOTES.txt
    httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
    httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/CPoolProxy.java

Modified: httpcomponents/httpasyncclient/branches/4.0.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.0.x/RELEASE_NOTES.txt?rev=1658693&r1=1658692&r2=1658693&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.0.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpasyncclient/branches/4.0.x/RELEASE_NOTES.txt Tue Feb 10 12:07:51 2015
@@ -1,6 +1,17 @@
 Changes since 4.0.2
 -------------------
 
+* [HTTPASYNC-86]: fixed a race condition upon connection lease from the connection pool:

+  in very rare  circumstances the main execution thread can get jammed for so long 
+  that the I/O dispatch thread succeeds in completing the request and releasing the connection

+  while the main still is performing connection validation.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+
+
+Release 4.0.2
+-------------------
+
 HttpAsyncClient 4.0.2 (GA) is a bug fix release that addresses several issues reported since

 release 4.0.1. This release also upgrades HttpClient dependency to the latest stable version.

 

Modified: httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java?rev=1658693&r1=1658692&r2=1658693&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
(original)
+++ httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
Tue Feb 10 12:07:51 2015
@@ -304,7 +304,7 @@ class DefaultClientExchangeHandlerImpl<T
 
             managedConn.getContext().setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER,
this);
             managedConn.requestOutput();
-            if (!managedConn.isOpen()) {
+            if (managedConn.isStale()) {
                 failed(new ConnectionClosedException("Connection closed"));
             }
         } catch (final RuntimeException runex) {

Modified: httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/CPoolProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/CPoolProxy.java?rev=1658693&r1=1658692&r2=1658693&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/CPoolProxy.java
(original)
+++ httpcomponents/httpasyncclient/branches/4.0.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/CPoolProxy.java
Tue Feb 10 12:07:51 2015
@@ -152,9 +152,9 @@ class CPoolProxy implements ManagedNHttp
     public boolean isStale() {
         final NHttpClientConnection conn = getConnection();
         if (conn != null) {
-            return conn.isStale() || !conn.isOpen();
+            return !conn.isOpen();
         } else {
-            return true;
+            return false;
         }
     }
 



Mime
View raw message