[
https://issues.apache.org/jira/browse/HDFS-3041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Todd Lipcon reassigned HDFS-3041:
---------------------------------
Assignee: (was: Todd Lipcon)
> DFSOutputStream.close doesn't properly handle interruption
> ----------------------------------------------------------
>
> Key: HDFS-3041
> URL: https://issues.apache.org/jira/browse/HDFS-3041
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs-client
> Affects Versions: 0.23.0, 2.0.0-alpha
> Reporter: Todd Lipcon
> Priority: Major
> Attachments: test.txt
>
>
> TestHFlush.testHFlushInterrupted can fail occasionally due to a race: if a
> thread is interrupted while calling close(), then the {{finally}} clause of
> the {{close}} function sets {{closed = true}}. At this point it has enqueued
> the "end of block" packet to the DNs, but hasn't called {{completeFile}}.
> Then, if {{close}} is called again (as in the test case), it will be
> short-circuited since {{closed}} is already true. Thus {{completeFile}} never
> ends up getting called. This also means that the test can fail if the
> pipeline is running slowly, since the assertion that the file is the correct
> length won't see the last packet or two.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]