From e00888d5cba7f47e1d5006d329f2523139423da3 Mon Sep 17 00:00:00 2001 From: Yongjun Zhang Date: Fri, 11 Dec 2015 17:33:55 -0800 Subject: [PATCH] HDFS-9532. Detailed exception info is lost in reportTo methods of ErrorReportAction and ReportBadBlockAction. (Yongjun Zhang) (cherry picked from commit f5a911452f8f6bc8a37617d1fc155e5ec23f3a78) Conflicts: hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hdfs/server/datanode/BPServiceActorActionException.java | 5 +++++ .../hadoop/hdfs/server/datanode/ErrorReportAction.java | 2 +- .../hadoop/hdfs/server/datanode/ReportBadBlockAction.java | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 1941ec3eb4a..4b134dee7fa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -871,6 +871,9 @@ Release 2.8.0 - UNRELEASED HDFS-9472. concat() API does not give proper exception messages on ./reserved relative path (Rakesh R via umamahesh) + HDFS-9532. Detailed exception info is lost in reportTo methods of + ErrorReportAction and ReportBadBlockAction. (Yongjun Zhang) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActorActionException.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActorActionException.java index 20282521b24..389ff263d2b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActorActionException.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActorActionException.java @@ -30,4 +30,9 @@ public class BPServiceActorActionException extends IOException { public BPServiceActorActionException(String message) { super(message); } + + public BPServiceActorActionException(String message, Throwable cause) { + super(message, cause); + } + } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ErrorReportAction.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ErrorReportAction.java index b7a9dae77a9..26498d4a0fc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ErrorReportAction.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ErrorReportAction.java @@ -49,7 +49,7 @@ public class ErrorReportAction implements BPServiceActorAction { + "errorMessage: " + errorMessage + " errorCode: " + errorCode, re); } catch(IOException e) { throw new BPServiceActorActionException("Error reporting " - + "an error to namenode: "); + + "an error to namenode.", e); } } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReportBadBlockAction.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReportBadBlockAction.java index 671a1fea18a..be46707afc3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReportBadBlockAction.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReportBadBlockAction.java @@ -65,7 +65,7 @@ public class ReportBadBlockAction implements BPServiceActorAction { + "block: " + block , re); } catch (IOException e) { throw new BPServiceActorActionException("Failed to report bad block " - + block + " to namenode: "); + + block + " to namenode.", e); } }