David Mollitor created HDFS-14843: ------------------------------------- Summary: 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
{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.2#803003) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org