zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject zookeeper git commit: ZOOKEEPER-2856: ZooKeeperSaslClient#respondToServer should log exception
Date Thu, 27 Jul 2017 00:24:34 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.5 5a29daede -> f671a6a08


ZOOKEEPER-2856: ZooKeeperSaslClient#respondToServer should log exception

See https://issues.apache.org/jira/browse/ZOOKEEPER-2856 for details.

When upstream like HBase call ZooKeeperSaslClient with security enabled, we sometimes get
error in HBase logs like:
`SASL authentication failed using login context 'Client'.`
This error occures when getting SaslException in ZooKeeperSaslClient#respondToServer :
`catch (SaslException e) {`
                `LOG.error("SASL authentication failed using login context '" +`
                       ` this.getLoginContext() + "'.");`
                `saslState = SaslState.FAILED;`
                `gotLastPacket = true;`
`  }`
This error makes user confused without explicit exception message. So I think we can add exception
message to the log.

The patch uses  parameterized logging to add the exception message to the log.

Author: panyuxuan <panyuxuan@cmss.chinamobile.com>

Reviewers: Michael Han <hanm@apache.org>

Closes #318 from pyx1990/ZOOKEEPER-2856

(cherry picked from commit 41b30a74ec8b33255e99d97a102de53d315c28b3)
Signed-off-by: Michael Han <hanm@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/f671a6a0
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/f671a6a0
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/f671a6a0

Branch: refs/heads/branch-3.5
Commit: f671a6a08258b911957cc2c3a9031a6d510ff8af
Parents: 5a29dae
Author: panyuxuan <panyuxuan@cmss.chinamobile.com>
Authored: Wed Jul 26 17:24:20 2017 -0700
Committer: Michael Han <hanm@apache.org>
Committed: Wed Jul 26 17:24:29 2017 -0700

----------------------------------------------------------------------
 src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/f671a6a0/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
----------------------------------------------------------------------
diff --git a/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java b/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
index 2dc697b..8550626 100644
--- a/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
+++ b/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
@@ -278,7 +278,7 @@ public class ZooKeeperSaslClient {
                 }
             } catch (SaslException e) {
                 LOG.error("SASL authentication failed using login context '" +
-                        this.getLoginContext() + "'.");
+                        this.getLoginContext() + "' with exception: {}", e);
                 saslState = SaslState.FAILED;
                 gotLastPacket = true;
             }


Mime
View raw message