From 258c181ade54c36e99d865d727107fc01f203414 Mon Sep 17 00:00:00 2001 From: Jing Zhao Date: Tue, 15 Oct 2013 01:17:21 +0000 Subject: [PATCH] HDFS-5352. Server#initLog() doesn't close InputStream in httpfs. Contributed by Ted Yu. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1532158 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/hadoop/lib/server/Server.java | 6 +++++- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java index 2b2d746af93..d083831c58a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java +++ b/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java @@ -418,7 +418,11 @@ public class Server { Properties props = new Properties(); try { InputStream is = getResource(DEFAULT_LOG4J_PROPERTIES); - props.load(is); + try { + props.load(is); + } finally { + is.close(); + } } catch (IOException ex) { throw new ServerException(ServerException.ERROR.S03, DEFAULT_LOG4J_PROPERTIES, ex.getMessage(), ex); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 586c5a88e00..bebf0f7891f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -340,6 +340,9 @@ Release 2.3.0 - UNRELEASED HDFS-5266. ElasticByteBufferPool#Key does not implement equals. (cnauroth) + HDFS-5352. Server#initLog() doesn't close InputStream in httpfs. (Ted Yu via + jing9) + Release 2.2.1 - UNRELEASED INCOMPATIBLE CHANGES