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] AIOps: Fixes render loop when using a saved search. #166934

Merged
merged 2 commits into from Sep 21, 2023

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Sep 21, 2023

Summary

Fixes #166079.

If a user picked a saved search to investigate, the log pattern analysis page would freeze with an infinite render loop; the log rate analysis pate wouldn't freeze but repeatedly query for new data.

This PR fixes the issue by memoizing the queries derived from the saved search information to avoid it being a new instance every time.

Checklist

@walterra walterra added bug Fixes for quality problems that affect the customer experience release_note:fix :ml Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis v8.11.0 v8.10.3 labels Sep 21, 2023
@walterra walterra self-assigned this Sep 21, 2023
@walterra walterra marked this pull request as ready for review September 21, 2023 13:20
@walterra walterra requested a review from a team as a code owner September 21, 2023 13:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

Tested LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
aiops 593.7KB 593.8KB +84.0B

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

cc @walterra

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 fabaa2f into elastic:main Sep 21, 2023
33 checks passed
@walterra walterra deleted the 166079-ml-aiops-fix-render-loop branch September 21, 2023 15:29
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 21, 2023
## Summary

Fixes elastic#166079.

If a user picked a saved search to investigate, the log pattern analysis
page would freeze with an infinite render loop; the log rate analysis
pate wouldn't freeze but repeatedly query for new data.

This PR fixes the issue by memoizing the queries derived from the saved
search information to avoid it being a new instance every time.

### Checklist

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit fabaa2f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.10

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 25, 2023
…#166956)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[ML] AIOps: Fix render loop when using saved search.
(#166934)](#166934)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"walter.rafelsberger@elastic.co"},"sourceCommit":{"committedDate":"2023-09-21T15:28:38Z","message":"[ML]
AIOps: Fix render loop when using saved search. (#166934)\n\n##
Summary\r\n\r\nFixes #166079.\r\n\r\nIf a user picked a saved search to
investigate, the log pattern analysis\r\npage would freeze with an
infinite render loop; the log rate analysis\r\npate wouldn't freeze but
repeatedly query for new data.\r\n\r\nThis PR fixes the issue by
memoizing the queries derived from the saved\r\nsearch information to
avoid it being a new instance every time.\r\n\r\n### Checklist\r\n\r\n-
[x] This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"fabaa2f89ecc7737b744b1a352251dc654d564a8","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix",":ml","Feature:ML/AIOps","v8.11.0","v8.10.3"],"number":166934,"url":"https://github.com/elastic/kibana/pull/166934","mergeCommit":{"message":"[ML]
AIOps: Fix render loop when using saved search. (#166934)\n\n##
Summary\r\n\r\nFixes #166079.\r\n\r\nIf a user picked a saved search to
investigate, the log pattern analysis\r\npage would freeze with an
infinite render loop; the log rate analysis\r\npate wouldn't freeze but
repeatedly query for new data.\r\n\r\nThis PR fixes the issue by
memoizing the queries derived from the saved\r\nsearch information to
avoid it being a new instance every time.\r\n\r\n### Checklist\r\n\r\n-
[x] This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"fabaa2f89ecc7737b744b1a352251dc654d564a8"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/166934","number":166934,"mergeCommit":{"message":"[ML]
AIOps: Fix render loop when using saved search. (#166934)\n\n##
Summary\r\n\r\nFixes #166079.\r\n\r\nIf a user picked a saved search to
investigate, the log pattern analysis\r\npage would freeze with an
infinite render loop; the log rate analysis\r\npate wouldn't freeze but
repeatedly query for new data.\r\n\r\nThis PR fixes the issue by
memoizing the queries derived from the saved\r\nsearch information to
avoid it being a new instance every time.\r\n\r\n### Checklist\r\n\r\n-
[x] This was checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"fabaa2f89ecc7737b744b1a352251dc654d564a8"}},{"branch":"8.10","label":"v8.10.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Walter Rafelsberger <walter.rafelsberger@elastic.co>
@peteharverson peteharverson changed the title [ML] AIOps: Fix render loop when using saved search. [ML] AIOps: Fixes render loop when using a saved search. Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:ML/AIOps ML AIOps features: Change Point Detection, Log Pattern Analysis, Log Rate Analysis :ml release_note:fix v8.10.3 v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] [AIOps] Saved search selection causes pages to hang
6 participants