Skip to content

Commit 39978b8

Browse files
committed
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 <vjasani@apache.org> Conflicts: hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
1 parent e8382ab commit 39978b8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ public Object run() throws IOException, InterruptedException {
395395
// A provider which failed authentication, but doesn't have the ability to relogin with
396396
// some external system (e.g. username/password, the password either works or it doesn't)
397397
if (!provider.canRetry()) {
398-
LOG.warn("Exception encountered while connecting to the server : " + ex);
398+
LOG.warn("Exception encountered while connecting to the server " + remoteId.getAddress(),
399+
ex);
399400
if (ex instanceof RemoteException) {
400401
throw (RemoteException) ex;
401402
}
@@ -410,7 +411,8 @@ public Object run() throws IOException, InterruptedException {
410411
// Other providers, like kerberos, could request a new ticket from a keytab. Let
411412
// them try again.
412413
if (currRetries < maxRetries) {
413-
LOG.debug("Exception encountered while connecting to the server", ex);
414+
LOG.debug("Exception encountered while connecting to the server " + remoteId.getAddress(),
415+
ex);
414416

415417
// Invoke the provider to perform the relogin
416418
provider.relogin();

hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ protected void initChannel(Channel ch) throws Exception {
296296
public void operationComplete(ChannelFuture future) throws Exception {
297297
Channel ch = future.channel();
298298
if (!future.isSuccess()) {
299-
failInit(ch, toIOE(future.cause()));
299+
IOException ex = toIOE(future.cause());
300+
LOG.warn(
301+
"Exception encountered while connecting to the server " + remoteId.getAddress(), ex);
302+
failInit(ch, ex);
300303
rpcClient.failedServers.addToFailedServers(remoteId.getAddress(), future.cause());
301304
return;
302305
}

0 commit comments

Comments
 (0)