Skip to content

Commit

Permalink
HBASE-27339 Improve sasl connection failure log message to include se…
Browse files Browse the repository at this point in the history
…rver (#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
  • Loading branch information
apurtell committed Oct 11, 2022
1 parent e8382ab commit 39978b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ public Object run() throws IOException, InterruptedException {
// 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;
}
Expand All @@ -410,7 +411,8 @@ public Object run() throws IOException, InterruptedException {
// 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ protected void initChannel(Channel ch) throws Exception {
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.getAddress(), future.cause());
return;
}
Expand Down

0 comments on commit 39978b8

Please sign in to comment.