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

David Mollitor commented on HDFS-14843:
---------------------------------------

[~elgoiri] Are you able to help me out on this one too?

> Double Synchronization in BlockReportLeaseManager
> -------------------------------------------------
>
>                 Key: HDFS-14843
>                 URL: https://issues.apache.org/jira/browse/HDFS-14843
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>         Attachments: HDFS-14843.1.patch
>
>
> {code:java|title=BlockReportLeaseManager.java}
>   private synchronized long getNextId() {
>     long id;
>     do {
>       id = nextId++;
>     } while (id == 0);
>     return id;
>   }
> {code}
> This is a private method and is synchronized, however, it is only be accessed 
> from an already-synchronized method.  No need to double-synchronize.
> https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java#L183-L189
> https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java#L227



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to