mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-16 15:07:27 +00:00
HTTPCLIENT-2188 - Improve logging when BasicHttpClientConnectionManager is still allocated
This commit is contained in:
parent
dd0bbda070
commit
d2a9977290
@ -303,7 +303,7 @@ synchronized ManagedHttpClientConnection getConnection(final HttpRoute route, fi
|
|||||||
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 @@ synchronized ManagedHttpClientConnection getConnection(final HttpRoute route, fi
|
|||||||
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…
x
Reference in New Issue
Block a user