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

Yiqun Lin edited comment on HDFS-10549 at 8/11/16 6:23 AM:
-----------------------------------------------------------

Thanks [~xiaochen] for the comments.
{quote}
should we mark that jira as a dup, and address all the places in this jira? 
{quote}
Agree with your idea. Can you help mark that jira? It seems that I am not 
allowed to do that in HADOOP-COMMON jiras. 

Post the new patch for adding the unit test. The test has passed in my local 
env and the test will failed if we keep the origin logic in 
{{DFSClient#closeAllFilesBeingWritten}}. Thanks for the review.


was (Author: linyiqun):
Thanks [~xiaochen] for the comments.
Agree with your idea. Post the new patch for adding the unit test. The test has 
passed in my local env and the test will failed if we keep the origin logic in 
{{DFSClient#closeAllFilesBeingWritten}}. Thanks for the review.

> Memory leak if exception happens when closing files being written
> -----------------------------------------------------------------
>
>                 Key: HDFS-10549
>                 URL: https://issues.apache.org/jira/browse/HDFS-10549
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 2.7.1
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-10549.001.patch, HDFS-10549.002.patch, 
> HDFS-10549.003.patch
>
>
> As HADOOP-13264 memtioned, the code dfsClient.endFileLease(fileId) in 
> {{DFSOutputStream}} will not be executed when the IOException happened in 
> {{closeImpl()}}.
> {code}
>   public void close() throws IOException {
>     synchronized (this) {
>       try (TraceScope ignored =
>           dfsClient.newPathTraceScope("DFSOutputStream#close", src)) {
>         closeImpl();
>       }
>     }
>     dfsClient.endFileLease(fileId);
>     }
>   }
> {code}
> This will cause that the files not be closed in {{DFSClient}} and finally 
> lead to the memory leak. In {{DFSStripedOutputStream}}, it existed the same 
> problem.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to