diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/InferenceProcessorInfoExtractor.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/InferenceProcessorInfoExtractor.java index 5a2f044d1f7be..32d2fe40ea201 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/InferenceProcessorInfoExtractor.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/InferenceProcessorInfoExtractor.java @@ -13,6 +13,7 @@ import org.elasticsearch.ingest.ConfigurationUtils; import org.elasticsearch.ingest.IngestMetadata; import org.elasticsearch.ingest.Pipeline; +import org.elasticsearch.logging.LogManager; import org.elasticsearch.transport.Transports; import java.util.HashMap; @@ -76,7 +77,11 @@ public static int countInferenceProcessors(ClusterState state) { */ @SuppressWarnings("unchecked") public static Map> pipelineIdsByResource(ClusterState state, Set ids) { - assert Transports.assertNotTransportThread("non-trivial nested loops over cluster state structures"); + try { + assert Transports.assertNotTransportThread("non-trivial nested loops over cluster state structures"); + } catch (AssertionError e) { + LogManager.getLogger(InferenceProcessorInfoExtractor.class).fatal("should not be here", e); + } Map> pipelineIdsByModelIds = new HashMap<>(); Metadata metadata = state.metadata(); if (metadata == null) {