From 5dd859a8a0d038ff04acbb96741a215d6a0e8c29 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 --- .../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 6349062a40..fc98d3a6b7 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 @@ -279,7 +279,10 @@ public void transferToSocketFully( 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; } }