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 2014/02/12 21:23:18 UTC
svn commit: r1567748 - in /httpcomponents/httpasyncclient/trunk:
RELEASE_NOTES.txt
httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultClientExchangeHandlerImpl.java
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);