Author: shv Date: Thu Nov 24 01:55:46 2011 New Revision: 1205699 URL: http://svn.apache.org/viewvc?rev=1205699&view=rev Log: HADOOP-7358. Improve log levels when exceptions caught in RPC handler. Contributed by Todd Lipcon.
Modified: hadoop/common/branches/branch-0.22/common/CHANGES.txt hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/ipc/Server.java Modified: hadoop/common/branches/branch-0.22/common/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/common/CHANGES.txt?rev=1205699&r1=1205698&r2=1205699&view=diff ============================================================================== --- hadoop/common/branches/branch-0.22/common/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.22/common/CHANGES.txt Thu Nov 24 01:55:46 2011 @@ -268,6 +268,9 @@ Release 0.22.0 - Unreleased 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(..). Modified: hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/ipc/Server.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/ipc/Server.java?rev=1205699&r1=1205698&r2=1205699&view=diff ============================================================================== --- hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/ipc/Server.java (original) +++ hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/ipc/Server.java Thu Nov 24 01:55:46 2011 @@ -1487,7 +1487,16 @@ public abstract class Server { ); } } catch (Throwable e) { - LOG.info(getName()+", call "+call+": error: " + e, 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