You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (Jira)" <ji...@apache.org> on 2022/01/13 14:02:00 UTC

[jira] [Resolved] (HTTPCLIENT-2188) Improve logging when BasicHttpClientConnectionManager is still allocated

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-2188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-2188.
-------------------------------------------
    Fix Version/s: 5.2-alpha2
       Resolution: Fixed

> Improve logging when BasicHttpClientConnectionManager is still allocated
> ------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2188
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2188
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient (classic)
>    Affects Versions: 4.5.13, 5.2-alpha1
>            Reporter: Aaron Digulla
>            Priority: Major
>             Fix For: 5.2-alpha2
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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 
> {code:java}
> Asserts.check(!this.leased, "Connection is still allocated"); {code}
> with
> {code:java}
> Asserts.check(!this.leased, "Connection %s is still allocated", conn); {code}
> 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:
> {code:java}
> if (this.log.isDebugEnabled()) {
>     this.log.debug("Using connection " + conn);
> } {code}
> Same for
> {code:java}
> Asserts.check(conn == this.conn, "Connection not obtained from this manager"); {code}
> which should be
> {code:java}
> Asserts.check(conn == this.conn, "Connection %s not obtained from this manager (%s)", conn, this.conn); {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org