HTTPCLIENT-2188 - Improve logging when BasicHttpClientConnectionManager is still allocated
This commit is contained in:
parent
dd0bbda070
commit
d2a9977290
|
@ -303,7 +303,7 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("{} Get connection for route {}", id, route);
|
LOG.debug("{} Get connection for route {}", id, route);
|
||||||
}
|
}
|
||||||
Asserts.check(!this.leased, "Connection is still allocated");
|
Asserts.check(!this.leased, "Connection %s is still allocated", conn);
|
||||||
if (!LangUtils.equals(this.route, route) || !LangUtils.equals(this.state, state)) {
|
if (!LangUtils.equals(this.route, route) || !LangUtils.equals(this.state, state)) {
|
||||||
closeConnection(CloseMode.GRACEFUL);
|
closeConnection(CloseMode.GRACEFUL);
|
||||||
}
|
}
|
||||||
|
@ -318,6 +318,9 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
|
||||||
this.conn.activate();
|
this.conn.activate();
|
||||||
}
|
}
|
||||||
this.leased = true;
|
this.leased = true;
|
||||||
|
if (LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("{} Using connection {}", id, conn);
|
||||||
|
}
|
||||||
return this.conn;
|
return this.conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue