HDFS-14843. Double Synchronization in BlockReportLeaseManager. Contributed by David Mollitor.
This commit is contained in:
parent
816d3cb908
commit
afa1006a53
@ -180,12 +180,8 @@ void addToBeginning(NodeData node) {
|
||||
/**
|
||||
* 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user