Skip to content

[7.x][ML] No error when datafeed stops during updating to started#46542

Merged
dimitris-athanasiou merged 1 commit intoelastic:7.xfrom
dimitris-athanasiou:no-error-when-datafeed-stops-before-updating-to-started-7x
Sep 11, 2019
Merged

[7.x][ML] No error when datafeed stops during updating to started#46542
dimitris-athanasiou merged 1 commit intoelastic:7.xfrom
dimitris-athanasiou:no-error-when-datafeed-stops-before-updating-to-started-7x

Conversation

@dimitris-athanasiou
Copy link
Copy Markdown
Contributor

(#46495)

Investigating the test failure reported in #45518 it appears that
the datafeed task was not found during a tast state update. There
are only two places where such an update is performed: when we set
the state to started and when we set it to stopping. We handle
ResourceNotFoundException in the latter but not in the former.

Thus the test reveals a rare race condition where the datafeed gets
requested to stop before we managed to update its state to started.
I could not reproduce this scenario but it would be my best guess.

This commit catches ResourceNotFoundException while updating the
state to started and lets the task terminate smoothly.

Closes #45518

Backport of #46495

…astic#46495)

Investigating the test failure reported in elastic#45518 it appears that
the datafeed task was not found during a tast state update. There
are only two places where such an update is performed: when we set
the state to `started` and when we set it to `stopping`. We handle
`ResourceNotFoundException` in the latter but not in the former.

Thus the test reveals a rare race condition where the datafeed gets
requested to stop before we managed to update its state to `started`.
I could not reproduce this scenario but it would be my best guess.

This commit catches `ResourceNotFoundException` while updating the
state to `started` and lets the task terminate smoothly.

Closes elastic#45518

Backport of elastic#46495
@dimitris-athanasiou dimitris-athanasiou added >test Issues or PRs that are addressing/adding tests :ml Machine learning backport v7.5.0 labels Sep 10, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/ml-core

@dimitris-athanasiou
Copy link
Copy Markdown
Contributor Author

run elasticsearch-ci/1

@dimitris-athanasiou
Copy link
Copy Markdown
Contributor Author

run elasticsearch-ci/bwc

@dimitris-athanasiou dimitris-athanasiou merged commit 579af62 into elastic:7.x Sep 11, 2019
@dimitris-athanasiou dimitris-athanasiou deleted the no-error-when-datafeed-stops-before-updating-to-started-7x branch September 11, 2019 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :ml Machine learning >test Issues or PRs that are addressing/adding tests v7.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants