From d799fbe1ccf8752c44f087e34b5f400591d3b5bd Mon Sep 17 00:00:00 2001 From: Yongjun Zhang Date: Sun, 8 Mar 2015 20:39:46 -0700 Subject: [PATCH] HDFS-7857. Improve authentication failure WARN message to avoid user confusion. Contributed by Yongjun Zhang. --- .../src/main/java/org/apache/hadoop/ipc/Server.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java index 893e0eb8903..d2d61b398d3 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java @@ -1324,10 +1324,15 @@ public abstract class Server { saslResponse = processSaslMessage(saslMessage); } catch (IOException e) { rpcMetrics.incrAuthenticationFailures(); + if (LOG.isDebugEnabled()) { + LOG.debug(StringUtils.stringifyException(e)); + } // attempting user could be null + IOException tce = (IOException) getTrueCause(e); AUDITLOG.warn(AUTH_FAILED_FOR + this.toString() + ":" - + attemptingUser + " (" + e.getLocalizedMessage() + ")"); - throw (IOException) getTrueCause(e); + + attemptingUser + " (" + e.getLocalizedMessage() + + ") with true cause: (" + tce.getLocalizedMessage() + ")"); + throw tce; } if (saslServer != null && saslServer.isComplete()) {