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

Colin Patrick McCabe commented on HDFS-10267:
---------------------------------------------

v3
* Refactor {{testStopWorker}} so that it accepts (essentially) a function 
pointer as an argument.  This avoids the need to have clunky if statements in 
{{testStopWorker}}.

* There are now three tests: {{testInitReplicaRecoveryDoesNotHoldLock}}, 
{{testRecoverAppendDoesNotHoldLock}}, and {{testRecoverCloseDoesNotHoldLock}}.  
Previously we were combining the test of {{initReplicaRecovery}} with testing 
other functions, which was awkward.

* Check that the {{stopWriter}} thread has attempted to stop the writer before 
proceeding in the main thread.  This makes test failures reproducible when the 
bad synchronization is present.  Previously, the test could randomly succeed 
even when there were bugs, due to a race condition.

* Add a timeout to our calls to {{Semaphore#acquire}}, so that junit's test 
timeout logic works as intended.

> Extra "synchronized" on FsDatasetImpl#recoverAppend and 
> FsDatasetImpl#recoverClose
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-10267
>                 URL: https://issues.apache.org/jira/browse/HDFS-10267
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 2.8.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-10267.001.patch, HDFS-10267.002.patch, 
> HDFS-10267.003.patch
>
>
> There is an extra "synchronized" on FsDatasetImpl#recoverAppend and 
> FsDatasetImpl#recoverClose that prevents the HDFS-8496 fix from working as 
> intended.  This should be removed.



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

Reply via email to