Skip to content

Commit

Permalink
[8.15][ML] Prevent NPE if model assignment is removed while waiting t…
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle authored Nov 5, 2024
1 parent 9647853 commit c977360
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/changelog/115430.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 115430
summary: Prevent NPE if model assignment is removed while waiting to start
area: Machine Learning
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,11 @@ public boolean test(ClusterState clusterState) {
deploymentId
).orElse(null);
if (trainedModelAssignment == null) {
// Something weird happened, it should NEVER be null...
// The assignment may be null if it was stopped by another action while waiting
this.exception = new ElasticsearchStatusException(
"Error waiting for the model deployment to start. The trained model assignment was removed while waiting",
RestStatus.BAD_REQUEST
);
logger.trace(() -> format("[%s] assignment was null while waiting for state [%s]", deploymentId, waitForState));
return true;
}
Expand Down

0 comments on commit c977360

Please sign in to comment.