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

Blue Arrow commented on YARN-1869:
----------------------------------

Shorter duration locks are good as a general principle for performance but do 
we know if the difference is worth worrying about in this case? One nice thing 
about the method being synchronized is that it makes the synchronization clear 
and visible when future code changes are made, which is always a plus when 
working with concurrency. (It does leave the possibility of deadlocks via 
external references versus synchronizing using a private). If we want to 
implement a shorter duration lock, we should make that consistent by modifying 
the other methods that are accessing zkAcl? Do we know if access/manipulation 
of zkAcl is the only critical section in these methods? Thoughts? 

> Access to zkAcl should be synchronized in ZKRMStateStore#addStoreOrUpdateOps()
> ------------------------------------------------------------------------------
>
>                 Key: YARN-1869
>                 URL: https://issues.apache.org/jira/browse/YARN-1869
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>         Attachments: yarn-1869.patch
>
>
> Here is related code:
> {code}
>       } else {
>         opList.add(Op.create(nodeCreatePath, tokenOs.toByteArray(), zkAcl,
>             CreateMode.PERSISTENT));
>       }
> {code}
> The other methods accessing zkAcl are synchronized.



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

Reply via email to