From 089d420a824ced46b806d0e5156999f0abad66aa Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Fri, 8 May 2015 11:25:24 +0530 Subject: [PATCH] HDFS-6291. FSImage may be left unclosed in BootstrapStandby#doRun() ( Contributed by Sanghyun Yun) (cherry picked from commit e5e492a9631ff78302fccedcb64d7b64b9407991) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/namenode/ha/BootstrapStandby.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index a51968da757..ab007270b52 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -334,6 +334,9 @@ Release 2.8.0 - UNRELEASED HDFS-8174. Update replication count to live rep count in fsck report. (J.Andreina) + HDFS-6291. FSImage may be left unclosed in BootstrapStandby#doRun() + (Sanghyun Yun via vinayakumarb) + Release 2.7.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java index 5981b4f8b43..7038dc03869 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java @@ -320,8 +320,9 @@ public class BootstrapStandby implements Tool, Configurable { image.saveDigestAndRenameCheckpointImage(NameNodeFile.IMAGE, imageTxId, hash); } catch (IOException ioe) { - image.close(); throw ioe; + } finally { + image.close(); } return 0; }