Parcourir la source

svn merge -c 1205697 Merging from trunk to branch-0.23 to fix HADOOP-7358.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1454530 13f79535-47bb-0310-9956-ffa450edef68
Kihwal Lee il y a 12 ans
Parent
commit
abd163f93e

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -33,6 +33,9 @@ Release 0.23.7 - UNRELEASED
 
     HADOOP-9374. Add tokens from -tokenCacheFile into UGI (daryn)
 
+    HADOOP-7358. Improve log levels when exceptions caught in RPC handler
+    (Todd Lipcon via shv)
+
   OPTIMIZATIONS
 
     HADOOP-9147. Add missing fields to FIleStatus.toString.

+ 10 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java

@@ -1538,7 +1538,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