Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [ML] Single metric viewer: Fix race condition when changing jobs. (#45420) #45643

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

walterra
Copy link
Contributor

Backports the following commits to 7.x:

…astic#45420)

Fixes a race condition where changing jobs in Single Metric Viewer could result in the focus chart being empty.
Applying the job change would cause two events to be triggered which would cause the Single Metric Viewer to refresh twice: The updated time range would be triggered via timefilter, the updated jobs via the globalState listener.
This PR solves the problem by setting a global flag skipRefresh which allows us to skip updating single metric viewer and only update again once both the new time range and jobs are set. The PR also adds some checks to avoid unnecessary updates in d3 code triggered by React render calls.
@walterra walterra self-assigned this Sep 13, 2019
@walterra walterra added the :ml label Sep 13, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@walterra walterra merged commit a232137 into elastic:7.x Sep 13, 2019
@walterra walterra deleted the backport/7.x/pr-45420 branch September 13, 2019 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants