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

Jing Zhao commented on HDFS-6227:
---------------------------------

Thanks for the fix, [~cmccabe]! The current patch looks good to me. Only some 
minor comments:
# Can we wrap the following check into a separate method in ShortCircuitReplica?
{code}
+        if (!replica.getDataStream().getChannel().isOpen()) {
+          purgeReason = "purging replica because its data channel is closed.";
+        } else if (!replica.getMetaStream().getChannel().isOpen()) {
+          purgeReason = "purging replica because its meta channel is closed.";
{code}
# Let's add a "dfs.close()" at the end of the new unit test 
testPurgingClosedReplicas.
# In testPurgingClosedReplicas, we may also want to call "sem.release()" if we 
catch a throwable other than ClosedByInterruptException. It is not necessary 
right now since we know we will catch a ClosedByInterruptException. But in case 
that some new code brings into another type of throwable, the test may get 
blocked for acquiring the semaphore.

> ShortCircuitCache#unref should purge ShortCircuitReplicas whose streams have 
> been closed by java interrupts
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-6227
>                 URL: https://issues.apache.org/jira/browse/HDFS-6227
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Jing Zhao
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-6227.000.patch, HDFS-6227.001.patch, 
> ShortCircuitReadInterruption.test.patch
>
>
> While running tests in a single node cluster, where short circuit read is 
> enabled and multiple threads may read the same file concurrently, one of the 
> read got ClosedChannelException and failed. Full exception trace see comment.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to