hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject hadoop git commit: HDFS-11087. NamenodeFsck should check if the output writer is still writable. Contributed by Erik Krogen.
Date Sun, 13 Nov 2016 23:10:18 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 95edf265b -> c997fc629


HDFS-11087. NamenodeFsck should check if the output writer is still writable. Contributed
by Erik Krogen.

(cherry picked from commit 98d9e9c4c823d865ddfc017e71c82d12c8328e53)

Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c997fc62
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c997fc62
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c997fc62

Branch: refs/heads/branch-2.7
Commit: c997fc629d9b89ba998decc56d410cf6341a71d9
Parents: 95edf26
Author: Erik Krogen <ekrogen@linkedin.com>
Authored: Sun Nov 13 14:50:33 2016 -0800
Committer: Konstantin V Shvachko <shv@apache.org>
Committed: Sun Nov 13 15:04:34 2016 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hdfs/server/namenode/NamenodeFsck.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c997fc62/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
index 3ff3c19..9c207af 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java
@@ -488,7 +488,14 @@ public class NamenodeFsck implements DataEncryptionKeyFactory {
     } else {
       out.print('.');
     }
-    if (res.totalFiles % 100 == 0) { out.println(); out.flush(); }
+    if (res.totalFiles % 100 == 0) {
+      out.println();
+      // checkError here will attempt to flush the stream, or report an error
+      // if the stream has encountered an error or been closed by the client
+      if (out.checkError()) {
+        throw new IOException("fsck encountered an error in its output stream");
+      }
+    }
     int missing = 0;
     int corrupt = 0;
     long missize = 0;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message