diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java index b2bc09bc392..20dd5e95ef9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java @@ -654,8 +654,12 @@ class BlockSender implements java.io.Closeable { if (ioem.startsWith(EIO_ERROR)) { throw new DiskFileCorruptException("A disk IO error occurred", e); } + String causeMessage = e.getCause() != null ? e.getCause().getMessage() : ""; + causeMessage = causeMessage != null ? causeMessage : ""; if (!ioem.startsWith("Broken pipe") - && !ioem.startsWith("Connection reset")) { + && !ioem.startsWith("Connection reset") + && !causeMessage.startsWith("Broken pipe") + && !causeMessage.startsWith("Connection reset")) { LOG.error("BlockSender.sendChunks() exception: ", e); datanode.getBlockScanner().markSuspectBlock( ris.getVolumeRef().getVolume().getStorageID(), block);