From 0fcbeed49a0251676df3ab2c83b1df434921d851 Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Wed, 18 Sep 2019 09:34:01 -0700 Subject: [PATCH] HDFS-14836. FileIoProvider should not increase FileIoErrors metric in datanode volume metric. Contributed by Aiphago. Reviewed-by: He Xiaoqiao (cherry picked from commit 5dd859a8a0d038ff04acbb96741a215d6a0e8c29) (cherry picked from commit b906f53b0d0e330d65a36295bfb8fe66d0a3995c) --- .../apache/hadoop/hdfs/server/datanode/FileIoProvider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FileIoProvider.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FileIoProvider.java index b8e08d0142f..cb2309d629d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FileIoProvider.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FileIoProvider.java @@ -281,7 +281,10 @@ public class FileIoProvider { waitTime, transferTime); profilingEventHook.afterFileIo(volume, TRANSFER, begin, count); } catch (Exception e) { - onFailure(volume, begin); + String em = e.getMessage(); + if (!em.startsWith("Broken pipe") && !em.startsWith("Connection reset")) { + onFailure(volume, begin); + } throw e; } }