From f5a911452f8f6bc8a37617d1fc155e5ec23f3a78 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) --- 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 09f08e93ec..1fda1d781c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1739,6 +1739,9 @@ Release 2.8.0 - UNRELEASED HDFS-9528. Cleanup namenode audit/log/exception messages. (szetszwo 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 20282521b2..389ff263d2 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 b7a9dae77a..26498d4a0f 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 void reportTo(DatanodeProtocolClientSideTranslatorPB bpNamenode, + "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 671a1fea18..be46707afc 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 void reportTo(DatanodeProtocolClientSideTranslatorPB bpNamenode, + "block: " + block , re); } catch (IOException e) { throw new BPServiceActorActionException("Failed to report bad block " - + block + " to namenode: "); + + block + " to namenode.", e); } }