hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r558802 - in /jakarta/httpcomponents/httpclient/trunk: RELEASE_NOTES.txt module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
Date Mon, 23 Jul 2007 17:16:46 GMT
Author: rolandw
Date: Mon Jul 23 10:16:44 2007
New Revision: 558802

URL: http://svn.apache.org/viewvc?view=rev&rev=558802
Log:
HTTPCLIENT-653: TSCCM is GCed after conn wrapper detach.

Modified:
    jakarta/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java

Modified: jakarta/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt?view=diff&rev=558802&r1=558801&r2=558802
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt (original)
+++ jakarta/httpcomponents/httpclient/trunk/RELEASE_NOTES.txt Mon Jul 23 10:16:44 2007
@@ -1,5 +1,9 @@
 Changes since release 4.0 Alpha 1
 
+* [HTTPCLIENT-653] detached connection wrapper no longer prevents
+  garbage collection of ThreadSafeClientConnManager
+  Contributed by Roland Weber <rolandw at apache.org>
+
 * [HTTPCLIENT-674] use org.apache.http.util.VersionInfo instead of a local one
   Contributed by Roland Weber <rolandw at apache.org>
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java?view=diff&rev=558802&r1=558801&r2=558802
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
Mon Jul 23 10:16:44 2007
@@ -348,20 +348,16 @@
         conn.markReusable();
         mgr.releaseConnection(conn);
 
-        // We now have a manager with an open connection. We drop all
-        // potential hard reference to it and check whether it is GCed.
-        // Note that the connection keeps a reference even if detached.
-        // Internal references might prevent that if set up incorrectly.
-
+        // We now have a manager with an open connection in it's pool.
+        // We drop all potential hard reference to the manager and check
+        // whether it is GCed. Internal references might prevent that
+        // if set up incorrectly.
+        // Note that we still keep references to the connection wrapper
+        // we got from the manager, directly as well as in the request
+        // and in the context. The manager will be GCed only if the
+        // connection wrapper is truly detached.
         WeakReference wref = new WeakReference(mgr);
-
-        request = null;
-        response = null;
         mgr = null;
-
-        //@@@ the connection currently prevents the manager from being GCed
-        conn = null;
-        httpContext = null; // holds the connection and request
 
         // Java does not guarantee that this will trigger the GC, but
         // it does in the test environment. GC is asynchronous, so we



Mime
View raw message