Browse Source

HDFS-9532. Detailed exception info is lost in reportTo methods of ErrorReportAction and ReportBadBlockAction. (Yongjun Zhang)

Yongjun Zhang 9 years ago
parent
commit
f5a911452f

+ 3 - 0
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

+ 5 - 0
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);
+  }
+
 }

+ 1 - 1
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);
     }
   }
 

+ 1 - 1
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);
     }
   }