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

Colin Patrick McCabe commented on HADOOP-10404:
-----------------------------------------------

Hi guys.  Thanks for looking at this.  Although we could fix it like you did, 
by taking the lock in {{NotificationHandler#handle}} and 
{{DomainSocketWatcher#kick}}, I would prefer to ensure that the lock is already 
taken in the watcher thread before these functions are invoked.  The lock is 
supposed to be already held at that point-- the only exception is that I forgot 
to hold the lock in the cleanup logic of watcherThread's run method.  It seems 
more consistent to just fix the cleanup logic.

I posted a v3 where I just take the lock there, and add 
assert(lock.isHeldByCurrentThread()) in {{NotificationHandler#handle}} and 
{{DomainSocketWatcher#kick}}.

> Some accesses to DomainSocketWatcher#closed are not protected by lock
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-10404
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10404
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Tsuyoshi OZAWA
>            Priority: Minor
>         Attachments: HADOOP-10404.003.patch, HADOOP-10404.1.patch, 
> HADOOP-10404.2.patch
>
>
> {code}
>    * Lock which protects toAdd, toRemove, and closed.
>    */
>   private final ReentrantLock lock = new ReentrantLock();
> {code}
> There're two places, NotificationHandler.handle() and kick(), where access to 
> closed is without holding lock.



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

Reply via email to