diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 42272ab1692..0483d1a67fb 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -1426,6 +1426,9 @@ Release 0.22.0 - 2011-11-29 HADOOP-7786. Remove HDFS-specific config keys defined in FsConfig. (eli) + HADOOP-7358. Improve log levels when exceptions caught in RPC handler + (Todd Lipcon via shv) + OPTIMIZATIONS HADOOP-6884. Add LOG.isDebugEnabled() guard for each LOG.debug(..). 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 9ec09cf990e..289bee77fe7 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 @@ -1627,7 +1627,16 @@ public abstract class Server { ); } } catch (Throwable e) { - LOG.info(getName() + ", call: " + call + ", error: ", e); + String logMsg = getName() + ", call " + call + ": error: " + e; + if (e instanceof RuntimeException || e instanceof Error) { + // These exception types indicate something is probably wrong + // on the server side, as opposed to just a normal exceptional + // result. + LOG.warn(logMsg, e); + } else { + LOG.info(logMsg, e); + } + errorClass = e.getClass().getName(); error = StringUtils.stringifyException(e); // Remove redundant error class name from the beginning of the stack trace