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 e0d85586115..b3e2fa6d468 --- 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 @@ public class DatanodeDescriptor extends DatanodeInfo { 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.