File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
plugin/src/main/java/org/opensearch/ml/action/undeploy Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -202,14 +202,16 @@ private void undeployModels(
202
202
*/
203
203
boolean modelNotFoundInNodesCache = response .getNodes ().stream ().allMatch (nodeResponse -> {
204
204
Map <String , String > status = nodeResponse .getModelUndeployStatus ();
205
- if (status == null ) return false ;
206
- boolean modelCacheMissForModelIds = Arrays .stream (modelIds ).allMatch (modelId -> {
205
+ if (status == null )
206
+ return false ;
207
+ // Stream is used to catch all models edge case but only one is ever undeployed
208
+ boolean modelCacheMissForModelIds = Arrays .stream (modelIds ).allMatch (modelId -> {
207
209
String modelStatus = status .get (modelId );
208
210
return modelStatus != null && modelStatus .equalsIgnoreCase (NOT_FOUND );
209
211
});
210
212
211
213
return modelCacheMissForModelIds ;
212
- } );
214
+ });
213
215
if (response .getNodes ().isEmpty () || modelNotFoundInNodesCache ) {
214
216
bulkSetModelIndexToUndeploy (modelIds , listener , response );
215
217
return ;
You can’t perform that action at this time.
0 commit comments