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

Xiao Chen commented on HDFS-9590:
---------------------------------

I take it back. So the locking itself looks to be exclusive - should only be 
acquired once. I guess that's why the unlock code doesn't have any protection. 
I'm still digging into the code to see how the given NPE was thrown...

> NPE in Storage$StorageDirectory#unlock()
> ----------------------------------------
>
>                 Key: HDFS-9590
>                 URL: https://issues.apache.org/jira/browse/HDFS-9590
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Xiao Chen
>            Assignee: Xiao Chen
>
> The code looks to be possible to have race conditions in multiple-threaded 
> runs.
> {code}
>     public void unlock() throws IOException {
>       if (this.lock == null)
>         return;
>       this.lock.release();
>       lock.channel().close();
>       lock = null;
>     }
> {code}
> This is called in a handful of places, and I don't see any protection. Shall 
> we add some synchronization mechanism? Not sure if I missed any design 
> assumptions here.



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

Reply via email to