From 5a1ed378939caa396ff27b1e6f2f229ece4f190c Mon Sep 17 00:00:00 2001 From: litao Date: Thu, 19 Aug 2021 12:30:38 +0800 Subject: [PATCH] HDFS-16177. Bug fix for Util#receiveFile (#3310) Reviewed-by: Hui Fei (cherry picked from commit 07627ef19e2bf4c87f12b53e508edf8fee05856a) --- .../main/java/org/apache/hadoop/hdfs/server/common/Util.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Util.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Util.java index 14cc1c4576d..be487bed257 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Util.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Util.java @@ -285,7 +285,7 @@ public final class Util { fos.getChannel().force(true); fos.close(); double writeSec = Math.max(((float) - (flushStartTime - Time.monotonicNow())) / 1000.0, 0.001); + (Time.monotonicNow() - flushStartTime)) / 1000.0, 0.001); xferCombined += writeSec; xferStats.append(String .format(" Synchronous (fsync) write to disk of " +