Skip to content

Commit d4f7c44

Browse files
HDFS-17847. OIV exits with code 0 (success) even when the output file is incomplete (#8042)
1 parent dd8fd7e commit d4f7c44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ public static int run(String[] args) throws Exception {
265265
printUsage();
266266
return -1;
267267
}
268+
if ((out != null) && out.checkError()) {
269+
System.err.println("CRITICAL FAILURE: PrintStream reported a write error " +
270+
"(e.g., Disk Full).");
271+
return -1;
272+
}
268273
return 0;
269274
} catch (EOFException e) {
270275
System.err.println("Input file ended unexpectedly. Exiting");

0 commit comments

Comments
 (0)