[
https://issues.apache.org/jira/browse/HADOOP-3592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614244#action_12614244
]
Chris Douglas commented on HADOOP-3592:
---------------------------------------
bq. This is Bill's patch with the same filename as the original patch, and some
(minor) spacing changes in the assignment operators.
To preserve the relevant history, whitespace and style changes are generally
deferred until the lines are changed for a purpose. Are any of the differences
between the updated and the original patches specifically related to this JIRA?
> org.apache.hadoop.fs.FileUtil.copy() will leak input streams if the
> destination can't be opened
> -----------------------------------------------------------------------------------------------
>
> Key: HADOOP-3592
> URL: https://issues.apache.org/jira/browse/HADOOP-3592
> Project: Hadoop Core
> Issue Type: Bug
> Components: fs
> Affects Versions: 0.19.0
> Reporter: Steve Loughran
> Priority: Minor
> Attachments: HADOOP-3592.patch, HADOOP-3592.patch
>
>
> FileUtil.copy() relies on IOUtils.copyBytes() to close the incoming streams,
> which it does. Normally.
> But if dstFS.create() raises any kind of IOException, then the inputstream
> "in", which was created in the line above, will never get closed, and hence
> be leaked.
> InputStream in = srcFS.open(src);
> OutputStream out = dstFS.create(dst, overwrite);
> IOUtils.copyBytes(in, out, conf, true);
> Some try/catch wrapper around the open operations could close the streams if
> any exception gets thrown at that point in the copy process.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.