From 542de969fa305eeffb71034f80750a601c0a9fe2 Mon Sep 17 00:00:00 2001 From: xinyual Date: Thu, 21 Nov 2024 16:30:05 +0800 Subject: [PATCH] change to a better class Signed-off-by: xinyual --- .../ml/action/models/DeleteModelTransportAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java index c9b1a3837a..8ecf8a2700 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java @@ -24,6 +24,7 @@ import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; @@ -354,7 +355,7 @@ private void checkSearchPipelineBeforeDeleteModel(String modelId, ActionListener private void checkDownstreamTaskBeforeDeleteModel(String modelId, Boolean isHidden, ActionListener actionListener) { CountDownLatch countDownLatch = new CountDownLatch(3); AtomicBoolean noneBlocked = new AtomicBoolean(true); - CopyOnWriteArrayList errorMessages = new CopyOnWriteArrayList<>(); + ConcurrentLinkedQueue errorMessages = new ConcurrentLinkedQueue<>(); ActionListener countDownActionListener = ActionListener.wrap(b -> { countDownLatch.countDown(); noneBlocked.compareAndSet(true, b);