From e515103a83e12ad4908c0ca0b4b1aa4a87e2a840 Mon Sep 17 00:00:00 2001 From: Chris Douglas Date: Fri, 15 Dec 2017 17:40:50 -0800 Subject: [PATCH] Revert "HDFS-12903. [READ] Fix closing streams in ImageWriter" This reverts commit c1bf2654b0e9118985b8518b0254eac4dd302a2f. --- .../org/apache/hadoop/hdfs/server/namenode/ImageWriter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-tools/hadoop-fs2img/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageWriter.java b/hadoop-tools/hadoop-fs2img/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageWriter.java index 1be5190ef2..14a5f8fa30 100644 --- a/hadoop-tools/hadoop-fs2img/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageWriter.java +++ b/hadoop-tools/hadoop-fs2img/src/main/java/org/apache/hadoop/hdfs/server/namenode/ImageWriter.java @@ -183,9 +183,9 @@ public ImageWriter(Options opts) throws IOException { dirsTmp.deleteOnExit(); dirsTmpStream = new FileOutputStream(dirsTmp); dirs = beginSection(dirsTmpStream); - } catch (Throwable e) { + } catch (IOException e) { IOUtils.cleanupWithLogger(null, raw, dirsTmpStream); - throw new IOException(e); + throw e; } try {