From 08763ed497b2353aeff304f5e88bae0f7f63c6e0 Mon Sep 17 00:00:00 2001 From: Aman Khare Date: Wed, 10 Apr 2024 11:52:41 +0530 Subject: [PATCH] Mark clearShard method as synchronized Signed-off-by: Aman Khare --- .../main/java/org/opensearch/gateway/AsyncShardBatchFetch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }