diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 30ec40f48fc..674909c551f 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -541,6 +541,8 @@ Release 2.6.0 - UNRELEASED YARN-2649. Fixed TestAMRMRPCNodeUpdates test failure. (Ming Ma 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) 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 de2af37ce94..d0bceee1eb0 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