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);