YARN-2662. TestCgroupsLCEResourcesHandler leaks file descriptors. Contributed by Chris Nauroth.

(cherry picked from commit d3afd730ac)
This commit is contained in:
cnauroth 2014-10-09 22:44:44 -07:00
parent f6278cbac5
commit b81641a310
2 changed files with 6 additions and 3 deletions

View File

@ -574,6 +574,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)

View File

@ -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