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)
This commit is contained in:
parent
db674a0b14
commit
d8bac50e12
@ -451,8 +451,11 @@ private void updateStorageStats(StorageReport[] reports, long cacheCapacity,
|
|||||||
this.volumeFailureSummary = volumeFailureSummary;
|
this.volumeFailureSummary = volumeFailureSummary;
|
||||||
for (StorageReport report : reports) {
|
for (StorageReport report : reports) {
|
||||||
|
|
||||||
DatanodeStorageInfo storage =
|
DatanodeStorageInfo storage = null;
|
||||||
|
synchronized (storageMap) {
|
||||||
|
storage =
|
||||||
storageMap.get(report.getStorage().getStorageID());
|
storageMap.get(report.getStorage().getStorageID());
|
||||||
|
}
|
||||||
if (checkFailedStorages) {
|
if (checkFailedStorages) {
|
||||||
failedStorageInfos.remove(storage);
|
failedStorageInfos.remove(storage);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user