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

Hudson commented on MAPREDUCE-5895:
-----------------------------------

SUCCESS: Integrated in Hadoop-trunk-Commit #5620 (See 
[https://builds.apache.org/job/Hadoop-trunk-Commit/5620/])
MAPREDUCE-5895. Close streams properly to avoid leakage in TaskLog. Contributed 
by Kousuke Saruta. (devaraj: 
http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1598209)
* /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
* 
/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java


> FileAlreadyExistsException was thrown : Temporary Index File can not be 
> cleaned up because OutputStream doesn't close properly
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-5895
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5895
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 3.0.0
>            Reporter: Kousuke Saruta
>            Assignee: Kousuke Saruta
>             Fix For: 3.0.0, 2.5.0
>
>         Attachments: MAPREDUCE-5895.patch, MAPREDUCE-5895.patch
>
>
> In TaskLog.java, Temporary Index File is created by following code.
> {code}
> BufferedOutputStream bos =
>   new BufferedOutputStream(
>     SecureIOUtils.createForWrite(tmpIndexFile, 0644));
> DataOutputStream dos = new DataOutputStream(bos);
> {code}
> The code is surrounded by try-finally so if some Exception/ERROR is thrown 
> between constructing bos and dos, temporary file is not cleaned up.
> I met the situation that when a thread ran, OOM was thrown after bos created 
> and temporary file is not cleaned up. At different time, another thread 
> executed same logic and fail because of FileAlreadyExistsException.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to