[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:
parent
5b19b8e7f0
commit
e549bc4ef9
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue