[ml] Set job state to failed when fetching required information for opening a job failed.

Relates to elastic/x-pack-elasticsearch#596

Original commit: elastic/x-pack-elasticsearch@6ad699df86
This commit is contained in:
Martijn van Groningen 2017-02-18 13:13:57 +01:00
parent 68324f5a50
commit 31c88ae1e5
1 changed files with 4 additions and 1 deletions

View File

@ -206,7 +206,10 @@ public class AutodetectProcessManager extends AbstractComponent {
}
setJobState(taskId, JobState.FAILED, e2 -> handler.accept(e1));
}
}, handler);
}, e1 -> {
logger.warn("Failed to gather information required to open job [" + jobId + "]", e1);
setJobState(taskId, JobState.FAILED, e2 -> handler.accept(e1));
});
}
// TODO: add a method on JobProvider that fetches all required info via 1 msearch call, so that we have a single lambda