hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Íñigo Goiri (Jira) <j...@apache.org>
Subject [jira] [Updated] (HDFS-14843) Double Synchronization in BlockReportLeaseManager
Date Tue, 24 Sep 2019 16:59:00 GMT

     [ https://issues.apache.org/jira/browse/HDFS-14843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Íñigo Goiri updated HDFS-14843:
-------------------------------
    Fix Version/s: 3.3.0
     Hadoop Flags: Reviewed
       Resolution: Fixed
           Status: Resolved  (was: Patch Available)

> 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
>             Fix For: 3.3.0
>
>         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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message