Skip to content

Commit 84d0a81

Browse files
brfrn169jojochuang
authored andcommitted
HDFS-15249 ThrottledAsyncChecker is not thread-safe. (apache#1922)
(cherry picked from commit c12ddbd) (cherry picked from commit e9b06d9) Change-Id: I7ad99401da2edf4b18fa57405f3e754284336239
1 parent ee7c746 commit 84d0a81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/ThrottledAsyncChecker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ public ThrottledAsyncChecker(final Timer timer,
117117
* will receive the same Future.
118118
*/
119119
@Override
120-
public Optional<ListenableFuture<V>> schedule(Checkable<K, V> target,
121-
K context) {
120+
public synchronized Optional<ListenableFuture<V>> schedule(
121+
Checkable<K, V> target, K context) {
122122
if (checksInProgress.containsKey(target)) {
123123
return Optional.empty();
124124
}

0 commit comments

Comments
 (0)