-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
fix dashboard index pattern race condition #72899
fix dashboard index pattern race condition #72899
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…oard-index-pattern-race-condition
@flash1293, what if do not show filter bar until index patterns are properly loaded? |
@Dosant Just realized you want to get this into 7.9, not showing the filter bar is fine for me then. Maybe we can add a nice loading state (Maybe a |
@Dosant Can we hold back the filters till the index patterns are loaded? So rendering an empty filter bar, then passing the filters through once the index patterns are ready? If that doesn't fit well I would be fine with the current state. |
@flash1293, I'd say doesn't fit :(, filters and index patterns get into filter bar in completely different code paths.
|
@Dosant I'm fine with the current state in that case. @majagrubic are you fine with that approach for now as well? We can improve in 7.10 |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@majagrubic is out this week, it seems like a pretty risky change for 7.9 at this point. @Dosant what do you think about moving this to 7.9.1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving as this is looking fine for me (with room for improvement as discussed) - we can already prepare the backports till we have a decision how to handle it
I strongly support fixing this bug and handling loading state during 7.10. |
src/plugins/dashboard/public/application/dashboard_app_controller.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some minor comments.
…ub.com:Dosant/kibana into dev/fix-dashboard-index-pattern-race-condition
@elasticmachine merge upstream |
💚 Build SucceededBuild metricspage load bundle size
History
To update your PR or re-run it, just comment with: |
* fix dashboard index pattern race condition * improve Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* fix dashboard index pattern race condition * improve Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: (44 commits) [Search] add server logs (elastic#72454) [SIEM][Timelines] Updates timeline template callout text (elastic#73334) Fix App status flaky test (elastic#72853) [Functional Tests] Increase the timeout when locating the tableview] (elastic#73243) Use "Apply_filter_trigger" in dashboard drilldown (elastic#71468) fix dashboard index pattern race condition (elastic#72899) [Functional Tests] Increase waitTime for timelion to fetch the results (elastic#73255) [Functional Tests] Fix flakiness on TSVB chart on switching index patterns test (elastic#73238) updates cypress to v4.11.0 (elastic#73327) [Metrics UI] Saved views bugs (elastic#72518) [Ingest Manager] Convert select agent config step to use combo box (elastic#73172) Exclude `version` from package config attributes that are copied, add safeguard to package config bulk create (elastic#73128) [Security Solution][ML] Updates siem group name to security (elastic#73218) [Security Solution] Show proper icon for termination status of all processes (elastic#73235) [Security Solution][Resolver] Show origin node details in panel on load (elastic#73313) [Security solution] Threat hunting test coverage improvements (elastic#73276) [Security Solution][Exceptions] - Update exception item comments to include id (elastic#73129) [Enterprise Search] Error state UI tweaks to account for current Cloud SSO behavior (elastic#73324) [dev/build/docker_generator] convert to typescript (elastic#73339) [APM] Fix focus map link on service map (elastic#73338) ...
Summary
Fixes #72601 - "Sometimes filters on non-default-indexpattern dashboard are stuck in warning state".
Please note: it doesn't fix flash of warning state during dashboard loading: #72899 (review). It makes sure we won't stuck in this state. Separate issue to address flickering: #73286
Looks like we hard race condition there for a long time, but noticed it because of #66979 which made it easily noticeable
Problem
There was a race condition when setting index pattern in a dashboard:
Old code:
And this function was called a bunch of times in the beginning.
On each getOutput$() change:
⬆️ but because code inside fetches defaults async, it could have happened that earlier calls finish last
Solution
I refactored that piece to use RxJS to get handy cancelations.
I didn't add any test, as not sure about the good way to test this. This fixes a race condition which would be hard to reliably catch in a function test. And dashboard controller need a refactor to start adding unit tests for logic there.
Release notes
Sometimes when creating filters on a dashboard suggestions from default index patterns were shown by mistake.