[
https://issues.apache.org/jira/browse/HDFS-9812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15159058#comment-15159058
]
Akira AJISAKA commented on HDFS-9812:
-------------------------------------
Thanks [~linyiqun] for updating the patch. I'm thinking we don't need to use
nested try-catch-finally clause. The code can be replaced by one
try-catch-finally clause as follows:
{code}
try {
// call some methods to flush buffer.
// don't need to call closeThreads(false) because the threads are closed by
the finally block.
} catch (ClosedChannelException ignored) {
} finally {
// don't need to call setClosed() because closeThreads(true) calls
setClosed() in the finally block.
closeThreads(true);
}
{code}
> Streamer threads leak if failure happens when closing the dfsoutputstream
> -------------------------------------------------------------------------
>
> Key: HDFS-9812
> URL: https://issues.apache.org/jira/browse/HDFS-9812
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs-client
> Affects Versions: 2.7.1
> Reporter: Lin Yiqun
> Assignee: Lin Yiqun
> Attachments: HDFS-9812.002.patch, HDFS-9812.003.patch, HDFS.001.patch
>
>
> In HDFS-9794, it has solved problem of that stream thread leak if failure
> happens when closing the striped outputstream. And in {{DfsOutpuStream}}, it
> also exists the same problem in {{DfsOutpuStream#closeImpl}}. If failures
> happen when flushing data blocks, the streamer threads will also not be
> closed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)