OpenSearch/x-pack/plugin/ml
Dimitris Athanasiou 63eb0d9081
[7.x][ML] Avoid marking data frame analytics task completed twice (#46721) (#46724)
When the stop API is called while the task is running there is
a chance the task gets marked completed twice. This may cause
undesired side effects, like indexing the progress document a second
time after the stop API has returned (the cause for #46705).

This commit adds a check that the task has not been completed before
proceeding to mark it so. In addition, when we update the task's state
we could get some warnings that the task was missing if the stop API
has been called in the meantime. We now check the errors are
`ResourceNotFoundException` and ignore them if so.

Closes #46705

Backports #46721
2019-09-15 17:25:26 +03:00
..
licenses [ML] Rename log structure to file structure (#33421) 2018-09-06 09:13:08 +01:00
qa [TEST] Remove incorrect data frame analytics state assertion (#46597) 2019-09-11 16:33:14 +01:00
src [7.x][ML] Avoid marking data frame analytics task completed twice (#46721) (#46724) 2019-09-15 17:25:26 +03:00
build.gradle Enable XLint warnings for ML (#44346) 2019-07-18 09:33:37 +01:00