[ML] Prevent notifications on deletion of a non existent job (#35337)
This commit is contained in:
parent
8a85251da0
commit
9494e046e7
|
@ -64,6 +64,7 @@ import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFiel
|
|||
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.CategorizerState;
|
||||
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.ModelSnapshot;
|
||||
import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.Quantiles;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobDataDeleter;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobResultsProvider;
|
||||
import org.elasticsearch.xpack.ml.notifications.Auditor;
|
||||
|
@ -136,6 +137,8 @@ public class TransportDeleteJobAction extends TransportMasterNodeAction<DeleteJo
|
|||
ActionListener<AcknowledgedResponse> listener) {
|
||||
logger.debug("Deleting job '{}'", request.getJobId());
|
||||
|
||||
JobManager.getJobOrThrowIfUnknown(request.getJobId(), state);
|
||||
|
||||
TaskId taskId = new TaskId(clusterService.localNode().getId(), task.getId());
|
||||
ParentTaskAssigningClient parentTaskClient = new ParentTaskAssigningClient(client, taskId);
|
||||
|
||||
|
|
|
@ -460,6 +460,13 @@
|
|||
}
|
||||
- match: { analysis_limits.model_memory_limit: "30mb" }
|
||||
|
||||
---
|
||||
"Test delete job that does not exist":
|
||||
- do:
|
||||
catch: missing
|
||||
xpack.ml.delete_job:
|
||||
job_id: not-a-job
|
||||
|
||||
---
|
||||
"Test delete job that is referred by a datafeed":
|
||||
- do:
|
||||
|
|
Loading…
Reference in New Issue