hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oz...@apache.org
Subject hadoop git commit: YARN-2988. Graph#save() may leak file descriptors. (Ted Yu via ozawa)
Date Thu, 25 Dec 2014 04:08:55 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 4f18018b7 -> b256dd760


YARN-2988. Graph#save() may leak file descriptors. (Ted Yu via ozawa)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/b256dd76
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/b256dd76
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/b256dd76

Branch: refs/heads/trunk
Commit: b256dd76006efbd4bcde3146a642fe0902d83dd2
Parents: 4f18018
Author: Tsuyoshi Ozawa <ozawa@apache.org>
Authored: Thu Dec 25 12:48:24 2014 +0900
Committer: Tsuyoshi Ozawa <ozawa@apache.org>
Committed: Thu Dec 25 12:48:24 2014 +0900

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                              | 2 ++
 .../src/main/java/org/apache/hadoop/yarn/state/Graph.java    | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b256dd76/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index f0d4af6..5dfb278 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -284,6 +284,8 @@ Release 2.7.0 - UNRELEASED
     YARN-2946. Fixed potential deadlock in RMStateStore. (Rohith Sharmaks via
     jianhe)
 
+    YARN-2988. Graph#save() may leak file descriptors. (Ted Yu via ozawa)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b256dd76/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java
index a090194..390deb2 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java
@@ -188,10 +188,10 @@ public class Graph {
   }
 
   public void save(String filepath) throws IOException {
-    OutputStreamWriter fout = new OutputStreamWriter(
-        new FileOutputStream(filepath), Charset.forName("UTF-8"));
-    fout.write(generateGraphViz());
-    fout.close();
+    try (OutputStreamWriter fout = new OutputStreamWriter(
+        new FileOutputStream(filepath), Charset.forName("UTF-8"));) {
+      fout.write(generateGraphViz());
+    }
   }
 
   public static List<Edge> combineEdges(List<Edge> edges) {


Mime
View raw message