diff --git a/plugin/build.gradle b/plugin/build.gradle index 5629801080..af976e6f9f 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -267,6 +267,7 @@ List jacocoExclusions = [ 'org.opensearch.ml.action.deploy.TransportDeployModelAction', 'org.opensearch.ml.action.deploy.TransportDeployModelOnNodeAction', 'org.opensearch.ml.action.prediction.TransportPredictionTaskAction', + 'org.opensearch.ml.action.prediction.TransportPredictionTaskAction.1', 'org.opensearch.ml.action.tasks.GetTaskTransportAction', 'org.opensearch.ml.action.tasks.SearchTaskTransportAction', 'org.opensearch.ml.model.MLModelManager', diff --git a/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java b/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java index 680524324d..554065ed95 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelCacheHelper.java @@ -436,7 +436,10 @@ public void setModelInfo(String modelId, MLModel mlModel) { } public MLModel getModelInfo(String modelId) { - MLModelCache mlModelCache = getExistingModelCache(modelId); + MLModelCache mlModelCache = modelCaches.get(modelId); + if (mlModelCache == null) { + return null; + } return mlModelCache.getCachedModelInfo(); }