hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1567748 - in /httpcomponents/httpasyncclient/trunk: RELEASE_NOTES.txt httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
Date Wed, 12 Feb 2014 20:23:18 GMT
Author: olegk
Date: Wed Feb 12 20:23:18 2014
New Revision: 1567748

URL: http://svn.apache.org/r1567748
Log:
HTTPASYNC-68: Connection closed by the opposite endpoint immediately upon its lease from the
pool is never released back and reclaimed by the pool (collection leak)
Contributed by Dmitry Potapov <potapov.d at gmail.com>

Modified:
    httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java

Modified: httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt?rev=1567748&r1=1567747&r2=1567748&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpasyncclient/trunk/RELEASE_NOTES.txt Wed Feb 12 20:23:18 2014
@@ -1,6 +1,10 @@
 Changes since 4.0
 -------------------
 
+* [HTTPASYNC-68] Connection closed by the opposite endpoint immediately upon its lease from
+  the pool is never released back and reclaimed by the pool (collection leak).
+  Contributed by Dmitry Potapov <potapov.d at gmail.com>
+
 * Persistent connections always get discarded in case of a response future cancellation
   even if they can be kept alive.
   Contributed by Oleg Kalnichevski <olegk at apache.org>

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java?rev=1567748&r1=1567747&r2=1567748&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
Wed Feb 12 20:23:18 2014
@@ -221,6 +221,10 @@ class DefaultClientExchangeHandlerImpl<T
     }
 
     public void abortConnection() {
+        discardConnection();
+    }
+
+    private void discardConnection() {
         final NHttpClientConnection localConn = this.managedConn.getAndSet(null);
         if (localConn != null) {
             try {
@@ -327,6 +331,9 @@ class DefaultClientExchangeHandlerImpl<T
             this.log.debug("[exchange: " + this.state.getId() + "] Request connection for
" +
                 this.state.getRoute());
         }
+
+        discardConnection();
+
         this.state.setValidDuration(0);
         this.state.setNonReusable();
         this.state.setRouteEstablished(false);



Mime
View raw message