hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi Prakash (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MAPREDUCE-2631) Potential resource leaks in BinaryProtocol$TeeOutputStream.java
Date Fri, 08 May 2015 16:46:00 GMT

     [ https://issues.apache.org/jira/browse/MAPREDUCE-2631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ravi Prakash updated MAPREDUCE-2631:
------------------------------------
    Attachment: MAPREDUCE-2631.02.patch

Thanks for the patch Sunil. In BinaryProtocol.close(), if out.close() throws an exception,
file will never be set to null right?
Uploading a new patch which does this:
{code}
    public void close() throws IOException {
      try {
        flush();
      } finally {
        IOUtils.closeStream(file);
        file = null;
        IOUtils.closeStream(file);
        out = null;
      }
    }
{code}
Similarly for IFileOutputStream  . Could you please review it?

> Potential resource leaks in BinaryProtocol$TeeOutputStream.java
> ---------------------------------------------------------------
>
>                 Key: MAPREDUCE-2631
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2631
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: jobtracker
>    Affects Versions: 0.23.0
>            Reporter: Ravi Teja Ch N V
>            Assignee: Sunil G
>         Attachments: 0001-MAPREDUCE-2631.patch, MAPREDUCE-2631.02.patch, MAPREDUCE-2631.1.patch,
MAPREDUCE-2631.2.patch, MAPREDUCE-2631.3.patch, MAPREDUCE-2631.patch
>
>
> {code:title=BinaryProtocol$TeeOutputStream.java|borderStyle=solid}
> public void close() throws IOException {
>       flush();
>       file.close();
>       out.close();
>     }
> {code} 
> In the above code, if the file.close() throws any exception out will not be closed.
>  



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

Mime
View raw message