HDFS-13962. Add null check for add-replica pool to avoid lock acquiring. Contributed by Surendra Singh Lilhore.
This commit is contained in:
parent
347ea38581
commit
1043795f7f
@ -183,8 +183,10 @@ public int compare(File f1, File f2) {
|
||||
.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 @@ ReplicaInfo addAndGet(String bpid, ReplicaInfo replicaInfo) {
|
||||
if (oldReplicaInfo != null) {
|
||||
return oldReplicaInfo;
|
||||
} else {
|
||||
set.add(replicaInfo);
|
||||
set.addOrReplace(replicaInfo);
|
||||
}
|
||||
return replicaInfo;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user