From e549bc4ef9a470a450e6d7d27f69e49c0883146c Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 21 Apr 2017 10:17:33 +0100 Subject: [PATCH] [ML] Index the audit notification before responding to a delete request (elastic/x-pack-elasticsearch#1150) This change prevents the situation where cleanup of ML indices immediately after deleting a job leaves the audit notification in limbo because the index it was due to be indexed into has been deleted. Relates elastic/x-pack-elasticsearch#1142 Original commit: elastic/x-pack-elasticsearch@300e9c36ce5d313429eedcbf3e8465443e891e48 --- .../main/java/org/elasticsearch/xpack/ml/job/JobManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java index 445c24f540f..89c27afe03f 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java @@ -278,8 +278,8 @@ public class JobManager extends AbstractComponent { CheckedConsumer apiResponseHandler = jobDeleted -> { if (jobDeleted) { logger.info("Job [" + jobId + "] deleted."); - actionListener.onResponse(new DeleteJobAction.Response(true)); auditor.info(jobId, Messages.getMessage(Messages.JOB_AUDIT_DELETED)); + actionListener.onResponse(new DeleteJobAction.Response(true)); } else { actionListener.onResponse(new DeleteJobAction.Response(false)); }