You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by sh...@apache.org on 2016/11/13 23:08:36 UTC
hadoop git commit: HDFS-11087. NamenodeFsck should check if the
output writer is still writable. Contributed by Erik Krogen.
Repository: hadoop
Updated Branches:
refs/heads/branch-2 fb3a5085e -> 98d9e9c4c
HDFS-11087. NamenodeFsck should check if the output writer is still writable. Contributed by Erik Krogen.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/98d9e9c4
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/98d9e9c4
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/98d9e9c4
Branch: refs/heads/branch-2
Commit: 98d9e9c4c823d865ddfc017e71c82d12c8328e53
Parents: fb3a508
Author: Erik Krogen <ek...@linkedin.com>
Authored: Sun Nov 13 14:50:33 2016 -0800
Committer: Konstantin V Shvachko <sh...@apache.org>
Committed: Sun Nov 13 14:50:33 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/98d9e9c4/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 6e5a1a4..060cfbd 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
@@ -526,7 +526,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");
+ }
+ }
}
private void collectBlocksSummary(String parent, HdfsFileStatus file,
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org