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

Tsz Wo (Nicholas), SZE commented on HDFS-547:
---------------------------------------------

Patch looks good. I only have some comments on the names.

{code}
     // shutdown datastreamer and responseprocessor threads.
- private void closeThreads() throws IOException {
+ // interrupt datastreamer if forClose is true
+ private void closeThreads(boolean forceClose) throws IOException {
{code}
- The existing name "closeThreads" is hard to understand. It does not directly 
close any thread but actually close the socket and DataStreamer. How about 
change it to something like "closeInternal"?
- Typo in the comment: "forClose". I suggest renaming "forceClose" to "force".

> TestHDFSFileSystemContract#testOutputStreamClosedTwice sometimes fails with 
> ClosedByInterruptException
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-547
>                 URL: https://issues.apache.org/jira/browse/HDFS-547
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs client
>    Affects Versions: Append Branch
>            Reporter: Hairong Kuang
>            Assignee: Hairong Kuang
>             Fix For: Append Branch
>
>         Attachments: closeDataStream.patch
>
>
> Here is the failed stack trace:
> {noformat}
> Testcase: testOutputStreamClosedTwice took 1.026 sec
>         Caused an ERROR
> null
> java.nio.channels.ClosedByInterruptException
>         at 
> java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184)
>         at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:341)
>         at 
> org.apache.hadoop.net.SocketOutputStream$Writer.performIO(SocketOutputStream.java:55)
>         at 
> org.apache.hadoop.net.SocketIOWithTimeout.doIO(SocketIOWithTimeout.java:142)
>         at 
> org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:146)
>         at 
> org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:107)
>         at 
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
>         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
>         at java.io.DataOutputStream.flush(DataOutputStream.java:106)
>         at 
> org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer.run(DFSClient.java:2438)
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to