Skip to content

Commit

Permalink
[ML][backport] Warn for model load failures if they have a status cod…
Browse files Browse the repository at this point in the history
…e <500 (elastic#113410)

* [ML][backport] Warn for model load failures if they have a status code <500

* On model load failure, warn if the failure status code was less tahn 500

* Update docs/changelog/113280.yaml
# Conflicts:
#	x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/TrainedModelAssignmentNodeService.java

* Update docs/changelog/113410.yaml

* fix merge
  • Loading branch information
maxhniebergall authored Sep 24, 2024
1 parent 6ee49a3 commit 20d56d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/changelog/113410.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 113410
summary: "[ML][backport] Warn for model load failures if they have a status code <500"
area: Machine Learning
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ResourceNotFoundException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.search.SearchPhaseExecutionException;
Expand Down Expand Up @@ -753,7 +754,11 @@ private void updateStoredState(String deploymentId, RoutingInfoUpdate update, Ac
}

private void handleLoadFailure(TrainedModelDeploymentTask task, Exception ex) {
logger.error(() -> "[" + task.getDeploymentId() + "] model [" + task.getParams().getModelId() + "] failed to load", ex);
if (ex instanceof ElasticsearchException esEx && esEx.status().getStatus() < 500) {
logger.warn(() -> "[" + task.getDeploymentId() + "] model [" + task.getParams().getModelId() + "] failed to load", ex);
} else {
logger.error(() -> "[" + task.getDeploymentId() + "] model [" + task.getParams().getModelId() + "] failed to load", ex);
}
if (task.isStopped()) {
logger.debug(
() -> format(
Expand Down

0 comments on commit 20d56d0

Please sign in to comment.