Merge r1588324 from trunk: YARN-1870. FileInputStream is not closed in ProcfsBasedProcessTree#constructProcessSMAPInfo. (Fengdong Yu via junping_du)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1588328 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Junping Du 2014-04-17 18:09:32 +00:00
parent bbabbe5ccb
commit d0db2c2b78
2 changed files with 4 additions and 2 deletions

View File

@ -38,6 +38,9 @@ Release 2.5.0 - UNRELEASED
YARN-1923. Make Fair Scheduler resource ratio calculations terminate faster
(Anubhav Dhoot via Sandy Ryza)
YARN-1870. FileInputStream is not closed in ProcfsBasedProcessTree#constructProcessSMAPInfo.
(Fengdong Yu via junping_du)
OPTIMIZATIONS
BUG FIXES

View File

@ -20,7 +20,6 @@ package org.apache.hadoop.yarn.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
@ -736,7 +735,7 @@ public class ProcfsBasedProcessTree extends ResourceCalculatorProcessTree {
fReader = new FileReader(file);
in = new BufferedReader(fReader);
ProcessSmapMemoryInfo memoryMappingInfo = null;
List<String> lines = IOUtils.readLines(new FileInputStream(file));
List<String> lines = IOUtils.readLines(in);
for (String line : lines) {
line = line.trim();
try {