You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2019/09/24 16:58:51 UTC

[hadoop] branch trunk updated: HDFS-14843. Double Synchronization in BlockReportLeaseManager. Contributed by David Mollitor.

This is an automated email from the ASF dual-hosted git repository.

inigoiri pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new afa1006  HDFS-14843. Double Synchronization in BlockReportLeaseManager. Contributed by David Mollitor.
afa1006 is described below

commit afa1006a537e1fc1adb5005cbdf4e4d8d9e98b22
Author: Inigo Goiri <in...@apache.org>
AuthorDate: Tue Sep 24 09:58:42 2019 -0700

    HDFS-14843. Double Synchronization in BlockReportLeaseManager. Contributed by David Mollitor.
---
 .../hdfs/server/blockmanagement/BlockReportLeaseManager.java      | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java
index 7db05c7..2a4b6e8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java
@@ -180,12 +180,8 @@ class BlockReportLeaseManager {
   /**
    * Get the next block report lease ID.  Any number is valid except 0.
    */
-  private synchronized long getNextId() {
-    long id;
-    do {
-      id = nextId++;
-    } while (id == 0);
-    return id;
+  private long getNextId() {
+    return ++nextId == 0L ? ++nextId : nextId;
   }
 
   public synchronized void register(DatanodeDescriptor dn) {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org