[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@300e9c36ce
This commit is contained in:
David Roberts 2017-04-21 10:17:33 +01:00 committed by GitHub
parent 5b19b8e7f0
commit e549bc4ef9
1 changed files with 1 additions and 1 deletions

View File

@ -278,8 +278,8 @@ public class JobManager extends AbstractComponent {
CheckedConsumer<Boolean, Exception> apiResponseHandler = jobDeleted -> { CheckedConsumer<Boolean, Exception> apiResponseHandler = jobDeleted -> {
if (jobDeleted) { if (jobDeleted) {
logger.info("Job [" + jobId + "] deleted."); logger.info("Job [" + jobId + "] deleted.");
actionListener.onResponse(new DeleteJobAction.Response(true));
auditor.info(jobId, Messages.getMessage(Messages.JOB_AUDIT_DELETED)); auditor.info(jobId, Messages.getMessage(Messages.JOB_AUDIT_DELETED));
actionListener.onResponse(new DeleteJobAction.Response(true));
} else { } else {
actionListener.onResponse(new DeleteJobAction.Response(false)); actionListener.onResponse(new DeleteJobAction.Response(false));
} }