Skip to content

Commit 4ec7ee5

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 <[email protected]> Conflicts: hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
1 parent 5a88745 commit 4ec7ee5

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
@@ -392,7 +392,8 @@ public Object run() throws IOException, InterruptedException {
392392
// A provider which failed authentication, but doesn't have the ability to relogin with
393393
// some external system (e.g. username/password, the password either works or it doesn't)
394394
if (!provider.canRetry()) {
395-
LOG.warn("Exception encountered while connecting to the server : " + ex);
395+
LOG.warn("Exception encountered while connecting to the server " + remoteId.getAddress(),
396+
ex);
396397
if (ex instanceof RemoteException) {
397398
throw (RemoteException) ex;
398399
}
@@ -407,7 +408,8 @@ public Object run() throws IOException, InterruptedException {
407408
// Other providers, like kerberos, could request a new ticket from a keytab. Let
408409
// them try again.
409410
if (currRetries < maxRetries) {
410-
LOG.debug("Exception encountered while connecting to the server", ex);
411+
LOG.debug("Exception encountered while connecting to the server " + remoteId.getAddress(),
412+
ex);
411413

412414
// Invoke the provider to perform the relogin
413415
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
@@ -290,7 +290,10 @@ protected void initChannel(Channel ch) throws Exception {
290290
public void operationComplete(ChannelFuture future) throws Exception {
291291
Channel ch = future.channel();
292292
if (!future.isSuccess()) {
293-
failInit(ch, toIOE(future.cause()));
293+
IOException ex = toIOE(future.cause());
294+
LOG.warn(
295+
"Exception encountered while connecting to the server " + remoteId.getAddress(), ex);
296+
failInit(ch, ex);
294297
rpcClient.failedServers.addToFailedServers(remoteId.address, future.cause());
295298
return;
296299
}

0 commit comments

Comments
 (0)