diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java old mode 100644 new mode 100755 index e0d8558611..b3e2fa6d46 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java @@ -339,7 +339,9 @@ boolean hasStaleStorages() { public void resetBlocks() { updateStorageStats(this.getStorageReports(), 0L, 0L, 0, 0, null); - this.invalidateBlocks.clear(); + synchronized (invalidateBlocks) { + this.invalidateBlocks.clear(); + } this.volumeFailures = 0; // pendingCached, cached, and pendingUncached are protected by the // FSN lock.