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

apurtell pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 4ec7ee5cb18 HBASE-27339 Improve sasl connection failure log message to 
include server (#4823)
4ec7ee5cb18 is described below

commit 4ec7ee5cb18224166b60271f8b86500356c3b1a9
Author: Andrew Purtell <[email protected]>
AuthorDate: Tue Oct 11 10:19:07 2022 -0700

    HBASE-27339 Improve sasl connection failure log message to include server 
(#4823)
    
    Include the remote server name in the logged exception message when the
    connection setup fails in BlockingRpcConnection.
    
    Add an equivalent log line in NettyRpcConnection.
    
    Signed-off-by: Viraj Jasani <[email protected]>
    
    Conflicts:
            
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
---
 .../java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java     | 6 ++++--
 .../main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java   | 5 ++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java
index e14d55d474c..60e2502524e 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java
@@ -392,7 +392,8 @@ class BlockingRpcConnection extends RpcConnection 
implements Runnable {
         // A provider which failed authentication, but doesn't have the 
ability to relogin with
         // some external system (e.g. username/password, the password either 
works or it doesn't)
         if (!provider.canRetry()) {
-          LOG.warn("Exception encountered while connecting to the server : " + 
ex);
+          LOG.warn("Exception encountered while connecting to the server " + 
remoteId.getAddress(),
+            ex);
           if (ex instanceof RemoteException) {
             throw (RemoteException) ex;
           }
@@ -407,7 +408,8 @@ class BlockingRpcConnection extends RpcConnection 
implements Runnable {
         // Other providers, like kerberos, could request a new ticket from a 
keytab. Let
         // them try again.
         if (currRetries < maxRetries) {
-          LOG.debug("Exception encountered while connecting to the server", 
ex);
+          LOG.debug("Exception encountered while connecting to the server " + 
remoteId.getAddress(),
+            ex);
 
           // Invoke the provider to perform the relogin
           provider.relogin();
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
index b1aeef72509..6a889678a5e 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
@@ -290,7 +290,10 @@ class NettyRpcConnection extends RpcConnection {
         public void operationComplete(ChannelFuture future) throws Exception {
           Channel ch = future.channel();
           if (!future.isSuccess()) {
-            failInit(ch, toIOE(future.cause()));
+            IOException ex = toIOE(future.cause());
+            LOG.warn(
+              "Exception encountered while connecting to the server " + 
remoteId.getAddress(), ex);
+            failInit(ch, ex);
             rpcClient.failedServers.addToFailedServers(remoteId.address, 
future.cause());
             return;
           }

Reply via email to