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

[ML] Explain log rate spikes: Fix race conditions when loading document count stats. #137715

Merged

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Aug 1, 2022

Summary

Part of #136265.

  • Fixes a race condition when loading document count stats for the histogram charts. Previously, data for the splitted histogram were loaded with to custom hooks in parallel which meant data in the chart could end up out of sync when transitioning from one state to the other.
  • Fixes another race condition where stale data fetched via hovering would populate the chart late. This was fixed by adding abort signals to the data fetching hooks.
  • Adds caching to the data fetched via hovering the analysis table rows.

Checklist

@walterra walterra added bug Fixes for quality problems that affect the customer experience :ml release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v8.4.0 v8.5.0 labels Aug 1, 2022
@walterra walterra self-assigned this Aug 1, 2022
@walterra walterra requested a review from a team as a code owner August 1, 2022 14:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 361 363 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 473.3KB 474.2KB +876.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @walterra

@qn895
Copy link
Member

qn895 commented Aug 1, 2022

Code LGTM 🎉

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ⚡

@walterra walterra merged commit 24de690 into elastic:main Aug 2, 2022
@walterra walterra deleted the ml-aiops-fix-use-data-race-condition branch August 2, 2022 08:58
kibanamachine pushed a commit that referenced this pull request Aug 2, 2022
…nt count stats. (#137715)

- Fixes a race condition when loading document count stats for the histogram charts. Previously, data for the splitted histogram were loaded with to custom hooks in parallel which meant data in the chart could end up out of sync when transitioning from one state to the other.
- Fixes another race condition where stale data fetched via hovering would populate the chart late. This was fixed by adding abort signals to the data fetching hooks.
- Adds caching to the data fetched via hovering the analysis table rows.

(cherry picked from commit 24de690)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

kibanamachine added a commit that referenced this pull request Aug 2, 2022
…nt count stats. (#137715) (#137817)

- Fixes a race condition when loading document count stats for the histogram charts. Previously, data for the splitted histogram were loaded with to custom hooks in parallel which meant data in the chart could end up out of sync when transitioning from one state to the other.
- Fixes another race condition where stale data fetched via hovering would populate the chart late. This was fixed by adding abort signals to the data fetching hooks.
- Adds caching to the data fetched via hovering the analysis table rows.

(cherry picked from commit 24de690)

Co-authored-by: Walter Rafelsberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience :ml release_note:skip Skip the PR/issue when compiling release notes v8.4.0 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants