HDFS-14610. HashMap is not thread safe. Field storageMap is typically synchronized by storageMap. However, in one place, field storageMap is not protected with synchronized. (#1015)
(cherry picked from commitd8bac50e12
) (cherry picked from commit76a9135947
)
This commit is contained in:
parent
122b02e288
commit
d95dd33ea1
|
@ -451,8 +451,11 @@ public class DatanodeDescriptor extends DatanodeInfo {
|
|||
this.volumeFailureSummary = volumeFailureSummary;
|
||||
for (StorageReport report : reports) {
|
||||
|
||||
DatanodeStorageInfo storage =
|
||||
storageMap.get(report.getStorage().getStorageID());
|
||||
DatanodeStorageInfo storage = null;
|
||||
synchronized (storageMap) {
|
||||
storage =
|
||||
storageMap.get(report.getStorage().getStorageID());
|
||||
}
|
||||
if (checkFailedStorages) {
|
||||
failedStorageInfos.remove(storage);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue