HDFS-17028. RBF: Optimize debug logs of class ConnectionPool and other related class. (#5694). Contributed by farmmamba.

Reviewed-by: Inigo Goiri <inigoiri@apache.org>
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
hfutatzhanghb 2023-06-05 17:04:46 +08:00 committed by GitHub
parent 1d0c9ab433
commit 2243cfd225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -150,8 +150,8 @@ public synchronized void close(boolean force) {
// this is an erroneous case, but we have to close the connection
// anyway since there will be connection leak if we don't do so
// the connection has been moved out of the pool
LOG.error("Active connection with {} handlers will be closed",
this.numThreads);
LOG.error("Active connection with {} handlers will be closed, ConnectionContext is {}",
this.numThreads, this);
}
this.closed = true;
Object proxy = this.client.getProxy();
@ -170,7 +170,10 @@ public String toString() {
Class<?> clazz = proxy.getClass();
StringBuilder sb = new StringBuilder();
sb.append(clazz.getSimpleName())
sb.append("hashcode:")
.append(hashCode())
.append(" ")
.append(clazz.getSimpleName())
.append("@")
.append(addr)
.append("x")

View File

@ -482,7 +482,7 @@ public void run() {
pool.getMaxSize(), pool);
}
} catch (IOException e) {
LOG.error("Cannot create a new connection", e);
LOG.error("Cannot create a new connection for {} {}", pool, e);
}
} catch (InterruptedException e) {
LOG.error("The connection creator was interrupted");

View File

@ -286,8 +286,8 @@ public synchronized List<ConnectionContext> removeConnections(int num) {
}
this.connections = tmpConnections;
}
LOG.debug("Expected to remove {} connection and actually removed {} connections",
num, removed.size());
LOG.debug("Expected to remove {} connection and actually removed {} connections "
+ "for connectionPool: {}", num, removed.size(), connectionPoolId);
return removed;
}