hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [46/50] [abbrv] git commit: YARN-2662. TestCgroupsLCEResourcesHandler leaks file descriptors. Contributed by Chris Nauroth.
Date Fri, 10 Oct 2014 19:01:25 GMT
YARN-2662. TestCgroupsLCEResourcesHandler leaks file descriptors. Contributed by Chris Nauroth.

(cherry picked from commit d3afd730acfa380ab5032be5ee296c5d73744518)
(cherry picked from commit b81641a31050b6a5cf5db3af636125e0617ffd56)
(cherry picked from commit 281041a57e56708a0ec6767b44d88f3765c57c94)

Conflicts:
	hadoop-yarn-project/CHANGES.txt


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

Branch: refs/heads/champlain
Commit: 616f3094d1d49ee5dde8d7c9b478257817cd456c
Parents: 5794c70
Author: cnauroth <cnauroth@apache.org>
Authored: Thu Oct 9 22:44:44 2014 -0700
Committer: cnauroth <cnauroth@apache.org>
Committed: Thu Oct 9 22:56:11 2014 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                               | 2 ++
 .../nodemanager/util/TestCgroupsLCEResourcesHandler.java      | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/616f3094/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 07c0514..8cbcb27 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -503,6 +503,8 @@ Release 2.6.0 - UNRELEASED
     YARN-2628. Capacity scheduler with DominantResourceCalculator carries out
     reservation even though slots are free. (Varun Vasudev via jianhe)
 
+    YARN-2662. TestCgroupsLCEResourcesHandler leaks file descriptors. (cnauroth)
+
   BREAKDOWN OF YARN-913 SUBTASKS AND RELATED JIRAS
 
     YARN-2652 Add hadoop-yarn-registry package under hadoop-yarn. (stevel)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/616f3094/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/util/TestCgroupsLCEResourcesHandler.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/util/TestCgroupsLCEResourcesHandler.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/util/TestCgroupsLCEResourcesHandler.java
index de2af37..d0bceee 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/util/TestCgroupsLCEResourcesHandler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/util/TestCgroupsLCEResourcesHandler.java
@@ -165,10 +165,11 @@ public class TestCgroupsLCEResourcesHandler {
 
   private int readIntFromFile(File targetFile) throws IOException {
     Scanner scanner = new Scanner(targetFile);
-    if (scanner.hasNextInt()) {
-      return scanner.nextInt();
+    try {
+      return scanner.hasNextInt() ? scanner.nextInt() : -1;
+    } finally {
+      scanner.close();
     }
-    return -1;
   }
 
   @Test


Mime
View raw message