You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2022/01/13 14:01:03 UTC

[httpcomponents-client] branch master updated: HTTPCLIENT-2188 - Improve logging when BasicHttpClientConnectionManager is still allocated

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/master by this push:
     new d2a9977  HTTPCLIENT-2188 - Improve logging when BasicHttpClientConnectionManager is still allocated
d2a9977 is described below

commit d2a9977290d05868c94ee027cfa3ef472b159dcd
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Tue Jan 11 18:53:56 2022 +0100

    HTTPCLIENT-2188 - Improve logging when BasicHttpClientConnectionManager is still allocated
---
 .../hc/client5/http/impl/io/BasicHttpClientConnectionManager.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/BasicHttpClientConnectionManager.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/BasicHttpClientConnectionManager.java
index 0c515c6..43fc1e8 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/BasicHttpClientConnectionManager.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/BasicHttpClientConnectionManager.java
@@ -303,7 +303,7 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
         if (LOG.isDebugEnabled()) {
             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)) {
             closeConnection(CloseMode.GRACEFUL);
         }
@@ -318,6 +318,9 @@ public class BasicHttpClientConnectionManager implements HttpClientConnectionMan
             this.conn.activate();
         }
         this.leased = true;
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("{} Using connection {}", id, conn);
+        }
         return this.conn;
     }