HDFS-13962. Add null check for add-replica pool to avoid lock acquiring. Contributed by Surendra Singh Lilhore.
(cherry picked from commit 1043795f7f
)
This commit is contained in:
parent
21553e22b6
commit
b6698e2a82
|
@ -183,8 +183,10 @@ class BlockPoolSlice {
|
|||
.setConf(conf)
|
||||
.setInitialUsed(loadDfsUsed())
|
||||
.build();
|
||||
// initialize add replica fork join pool
|
||||
initializeAddReplicaPool(conf);
|
||||
if (addReplicaThreadPool == null) {
|
||||
// initialize add replica fork join pool
|
||||
initializeAddReplicaPool(conf);
|
||||
}
|
||||
// Make the dfs usage to be saved during shutdown.
|
||||
shutdownHook = new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -154,7 +154,7 @@ class ReplicaMap {
|
|||
if (oldReplicaInfo != null) {
|
||||
return oldReplicaInfo;
|
||||
} else {
|
||||
set.add(replicaInfo);
|
||||
set.addOrReplace(replicaInfo);
|
||||
}
|
||||
return replicaInfo;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue