hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-11414) FileBasedIPList#readLines() can leak file descriptors
Date Mon, 22 Dec 2014 04:13:13 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-11414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14255417#comment-14255417
] 

Hudson commented on HADOOP-11414:
---------------------------------

FAILURE: Integrated in Hadoop-trunk-Commit #6773 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/6773/])
HADOOP-11414. FileBasedIPList#readLines() can leak file descriptors. (ozawa) (ozawa: rev ecf1469fa51f9977f70652fac313d4a9ec1eb86f)
* hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/FileBasedIPList.java
* hadoop-common-project/hadoop-common/CHANGES.txt


> FileBasedIPList#readLines() can leak file descriptors
> -----------------------------------------------------
>
>                 Key: HADOOP-11414
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11414
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.6.0
>            Reporter: Ted Yu
>            Assignee: Tsuyoshi OZAWA
>            Priority: Minor
>             Fix For: 2.7.0
>
>         Attachments: HADOOP-11414.1.patch, HADOOP-11414.2.patch, HADOOP-11414.3.patch,
HADOOP-11414.4.patch
>
>
> {code}
>           Reader fileReader = new InputStreamReader(
>               new FileInputStream(file), Charsets.UTF_8);
>           BufferedReader bufferedReader = new BufferedReader(fileReader);
>           List<String> lines = new ArrayList<String>();
>           String line = null;
>           while ((line = bufferedReader.readLine()) != null) {
>             lines.add(line);
>           }
>           bufferedReader.close();
> {code}
> Since bufferedReader.readLine() may throw IOE, so the close of bufferedReader should
be enclosed within finally block.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message