HDFS-12903. [READ] Fix closing streams in ImageWriter

This commit is contained in:
Virajith Jalaparti 2017-12-07 14:21:24 -08:00 committed by Chris Douglas
parent 71ec170107
commit 962b5e722b

View File

@ -183,9 +183,9 @@ public ImageWriter(Options opts) throws IOException {
dirsTmp.deleteOnExit();
dirsTmpStream = new FileOutputStream(dirsTmp);
dirs = beginSection(dirsTmpStream);
} catch (IOException e) {
} catch (Throwable e) {
IOUtils.cleanupWithLogger(null, raw, dirsTmpStream);
throw e;
throw new IOException(e);
}
try {