[
https://issues.apache.org/jira/browse/HADOOP-11392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14243693#comment-14243693
]
Yongjun Zhang commented on HADOOP-11392:
----------------------------------------
Hi [~brahmareddy], somehow I misread your proposed change of the *close=false*
case a moment ago. I think it would be more consistent to use
{{IOUtils.closestream()}} as you proposed. Thanks.
> FileUtil.java leaks file descriptor when copybytes success.
> -----------------------------------------------------------
>
> Key: HADOOP-11392
> URL: https://issues.apache.org/jira/browse/HADOOP-11392
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Brahma Reddy Battula
> Assignee: Brahma Reddy Battula
> Attachments: HADOOP-11392.patch
>
>
> Please check following code for same..
> {code}
> try {
> in = srcFS.open(src);
> out = dstFS.create(dst, overwrite);
> IOUtils.copyBytes(in, out, conf, true);
> } catch (IOException e) {
> IOUtils.closeStream(out);
> IOUtils.closeStream(in);
> throw e;
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)