diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/ThrottledAsyncChecker.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/ThrottledAsyncChecker.java index 4ad32aefbb2..f969c7ade28 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/ThrottledAsyncChecker.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/ThrottledAsyncChecker.java @@ -117,8 +117,8 @@ public class ThrottledAsyncChecker implements AsyncChecker { * will receive the same Future. */ @Override - public Optional> schedule(Checkable target, - K context) { + public synchronized Optional> schedule( + Checkable target, K context) { if (checksInProgress.containsKey(target)) { return Optional.empty(); }