HDFS-16897. Fix abundant Broken pipe exception in BlockSender (#5329). Contributed by fanluo.
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
parent
70c0aa342e
commit
1a2cd965a7
@ -654,8 +654,12 @@ private int sendPacket(ByteBuffer pkt, int maxChunks, OutputStream out,
|
|||||||
if (ioem.startsWith(EIO_ERROR)) {
|
if (ioem.startsWith(EIO_ERROR)) {
|
||||||
throw new DiskFileCorruptException("A disk IO error occurred", e);
|
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")
|
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);
|
LOG.error("BlockSender.sendChunks() exception: ", e);
|
||||||
datanode.getBlockScanner().markSuspectBlock(
|
datanode.getBlockScanner().markSuspectBlock(
|
||||||
ris.getVolumeRef().getVolume().getStorageID(), block);
|
ris.getVolumeRef().getVolume().getStorageID(), block);
|
||||||
|
Loading…
Reference in New Issue
Block a user