瀏覽代碼

YARN-949. Failed log aggregation can leave a file open. Contributed by Kihwal Lee

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1507095 13f79535-47bb-0310-9956-ffa450edef68
Jason Darrell Lowe 11 年之前
父節點
當前提交
0bebe46614

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -12,6 +12,9 @@ Release 0.23.10 - UNRELEASED
 
   BUG FIXES
 
+    YARN-949. Failed log aggregation can leave a file open. (Kihwal Lee via
+    jlowe)
+
 Release 0.23.9 - 2013-07-08
 
   INCOMPATIBLE CHANGES

+ 3 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/AggregatedLogFormat.java

@@ -184,7 +184,9 @@ public class AggregatedLogFormat {
               out.write(buf, 0, len);
             }
           } finally {
-            in.close();
+            if (in != null) {
+              in.close();
+            }
           }
         }
       }