Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.5.13, 5.2-alpha1
-
None
Description
When BasicHttpClientConnectionManager reports that a connection is still allocated, it should also print the name of the connection just like it does when it closes the connection. That would make it easier to pinpoint which connection wasn't released properly.
Please replace
Asserts.check(!this.leased, "Connection is still allocated");
with
Asserts.check(!this.leased, "Connection %s is still allocated", conn);
Rationale: If leased is true, then conn must be != null.
At the end of the method org.apache.http.impl.conn.BasicHttpClientConnectionManager.getConnection(HttpRoute, Object), add logging about the connection:
if (this.log.isDebugEnabled()) { this.log.debug("Using connection " + conn); }
Same for
Asserts.check(conn == this.conn, "Connection not obtained from this manager");
which should be
Asserts.check(conn == this.conn, "Connection %s not obtained from this manager (%s)", conn, this.conn);