hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1558916 - in /httpcomponents/httpcore/branches/4.3.x: RELEASE_NOTES.txt httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
Date Thu, 16 Jan 2014 20:54:23 GMT
Author: olegk
Date: Thu Jan 16 20:54:23 2014
New Revision: 1558916

URL: http://svn.apache.org/r1558916
Log:
HTTPCORE-370: Race condition if connection request succeeds and times out at the same time

Modified:
    httpcomponents/httpcore/branches/4.3.x/RELEASE_NOTES.txt
    httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java

Modified: httpcomponents/httpcore/branches/4.3.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.3.x/RELEASE_NOTES.txt?rev=1558916&r1=1558915&r2=1558916&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.3.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpcore/branches/4.3.x/RELEASE_NOTES.txt Thu Jan 16 20:54:23 2014
@@ -1,6 +1,9 @@
 Changes since release 4.3.1
 -------------------
 
+* [HTTPCORE-370] Race condition if connection request succeeds and times out at the same
time.  
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * (Regression) Fixed synchronization issue in blocking and non-blocking connection pool 
   implementations caused by HTTPCORE-362
   Contributed by Oleg Kalnichevski <olegk at apache.org>

Modified: httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java?rev=1558916&r1=1558915&r2=1558916&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
(original)
+++ httpcomponents/httpcore/branches/4.3.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
Thu Jan 16 20:54:23 2014
@@ -177,11 +177,19 @@ public class DefaultConnectingIOReactor 
                 key.cancel();
                 if (channel.isConnected()) {
                     addChannel(new ChannelEntry(channel, sessionRequest));
+                    key.attach(null);
                 }
             }
 
         } catch (final CancelledKeyException ex) {
+            final SessionRequestHandle requestHandle = (SessionRequestHandle) key.attachment();
             key.attach(null);
+            if (requestHandle != null) {
+                final SessionRequestImpl sessionRequest = requestHandle.getSessionRequest();
+                if (sessionRequest != null) {
+                    sessionRequest.cancel();
+                }
+            }
         }
     }
 



Mime
View raw message