From 5c7cb51775bd3d4a6e3e1bd501b3a8d747733fe3 Mon Sep 17 00:00:00 2001 From: Tsz-wo Sze Date: Wed, 2 Apr 2014 01:00:44 +0000 Subject: [PATCH] HADOOP-10455. When there is an exception, ipc.Server should first check whether it is an terse exception. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1583842 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/ipc/Server.java | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index d0322ab1f8..3b5d38f501 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -350,6 +350,9 @@ Release 2.4.1 - UNRELEASED BUG FIXES + HADOOP-10455. When there is an exception, ipc.Server should first check + whether it is an terse exception. (szetszwo) + Release 2.4.0 - 2014-04-07 INCOMPATIBLE CHANGES 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 e77ccc7215..e50e351d00 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 @@ -2107,16 +2107,15 @@ public Writable run() throws Exception { if (e instanceof UndeclaredThrowableException) { e = e.getCause(); } - String logMsg = Thread.currentThread().getName() + ", call " + call + ": error: " + e; - if (e instanceof RuntimeException || e instanceof Error) { + String logMsg = Thread.currentThread().getName() + ", call " + call; + if (exceptionsHandler.isTerse(e.getClass())) { + // Don't log the whole stack trace. Way too noisy! + LOG.info(logMsg + ": " + e); + } else 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 if (exceptionsHandler.isTerse(e.getClass())) { - // Don't log the whole stack trace of these exceptions. - // Way too noisy! - LOG.info(logMsg); } else { LOG.info(logMsg, e); }