diff --git a/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java b/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java index ca769235a8053..4f39a39cea678 100644 --- a/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java +++ b/server/src/main/java/org/opensearch/gateway/AsyncShardBatchFetch.java @@ -75,7 +75,7 @@ public abstract class AsyncShardBatchFetch extend * * @param shardId shardId to be removed from the batch. */ - public void clearShard(ShardId shardId) { + public synchronized void clearShard(ShardId shardId) { this.shardAttributesMap.remove(shardId); this.cache.deleteShard(shardId); }