From b3e7d436e5c32dd29253e55970a7b9210bc34aa7 Mon Sep 17 00:00:00 2001 From: Nick Tindall Date: Thu, 1 Aug 2024 11:04:01 +1000 Subject: [PATCH] Fix IndexFoldersDeletionListenerIT#testListenersInvokedWhenIndexIsDangling (#111440) Closes #111192 --- .../elasticsearch/plugins/IndexFoldersDeletionListenerIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/plugins/IndexFoldersDeletionListenerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/plugins/IndexFoldersDeletionListenerIT.java index 542a4cd2c4c92..db26d630fefea 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/plugins/IndexFoldersDeletionListenerIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/plugins/IndexFoldersDeletionListenerIT.java @@ -350,7 +350,7 @@ public void beforeIndexFoldersDeleted(Index index, IndexSettings indexSettings, @Override public void beforeShardFoldersDeleted(ShardId shardId, IndexSettings indexSettings, Path[] shardPaths) { - deletedShards.computeIfAbsent(shardId.getIndex(), i -> new ArrayList<>()).add(shardId); + deletedShards.computeIfAbsent(shardId.getIndex(), i -> Collections.synchronizedList(new ArrayList<>())).add(shardId); } }); }