Skip to content

Commit afa1006

Browse files
author
Inigo Goiri
committed
HDFS-14843. Double Synchronization in BlockReportLeaseManager. Contributed by David Mollitor.
1 parent 816d3cb commit afa1006

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,8 @@ void addToBeginning(NodeData node) {
180180
/**
181181
* Get the next block report lease ID. Any number is valid except 0.
182182
*/
183-
private synchronized long getNextId() {
184-
long id;
185-
do {
186-
id = nextId++;
187-
} while (id == 0);
188-
return id;
183+
private long getNextId() {
184+
return ++nextId == 0L ? ++nextId : nextId;
189185
}
190186

191187
public synchronized void register(DatanodeDescriptor dn) {

0 commit comments

Comments
 (0)