-
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
[Monitoring] Use async/await #81200
[Monitoring] Use async/await #81200
Conversation
Pinging @elastic/stack-monitoring (Team:Monitoring) |
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.
@chrisronline This works, but I don't really know why, since the only thing that was changed here was converting some angular promises into async/await (with try/catch) functions (unless I'm missing something else?)
What I never really like in our code base is that we have logic in several places eg:
x-pack/plugins/monitoring/public/views/cluster/listing/index.js
that points to #/overview
and our routeInit()
function (which is used with all our routes' resolve method) can also redirect you back to #/home
. Which I'm sure under the right conditions can cause the infinite loop mentioned above.
But, I honestly don't know if there's a better way of solving this
@chrisronline thanks for addressing this - I ultimately had to skip these tests for now so you will want to revert that as part of this PR: #81166 |
💚 Build SucceededMetrics [docs]async chunks size
History
To update your PR or re-run it, just comment with: |
* Use async/await * Make sure we tell angular what's up
* Use async/await * Make sure we tell angular what's up # Conflicts: # x-pack/plugins/monitoring/public/services/clusters.js
* master: (63 commits) [KP] Fix Headers timeout issue (elastic#81140) [ML] Functional tests - stabilize typing with checks service method (elastic#81338) tabify - support docs (elastic#80351) [Security Solution][Detections] Look-back time logic fix (elastic#81383) [Workplace Search] Add top-level tests for Groups (elastic#81215) [Fleet] Fix agent action observable for long polling (elastic#81376) [Maps] fix feature tooltip remains open when zoom level change hides layer (elastic#81373) skip flaky suite (elastic#78689) chore(NA): add spec-to-console and plugin-helpers as devOnly dependencies (elastic#81357) Ensure some data is returned (elastic#81375) Change dumb-init to tini (elastic#81126) [Reporting/Tech Debt] Convert PdfMaker class to TypeScript (elastic#81242) Use Storybook Controls instead of Knobs (elastic#80705) [junit] make sure that report paths are unique (elastic#81255) bump elastic/elasticsearch-js version to 7.10.0-rc1 (elastic#81288) run ssl tests on CI (elastic#81320) Fix alert defaults (elastic#81207) [ML] DF Analytics wizard: ensure user can set mml manually or select to use given estimate (elastic#81078) Add UI notifier to indicate secret fields and to remember / reenter values (elastic#80657) [Monitoring] Use async/await (elastic#81200) ...
Resolves #81104
Resolves #72007
Resolves #81166
Resolves #81084
Resolves #81225
Resolves #81312
Resolves #53159
Resolves #81340
Resolves #81113
I'm not really sure what's going on here.
I ran tests locally on 7.x and didn't experience any failure. Then, I decided to load up the es archive data and play around with the app to make sure things looked fine. I noticed that I got into an infinite navigation loop by simply loading the cluster overview page and then clicking
Clusters
in the top left. It went from#/home
to#/overview
back and forth forever.I added some debugging and found that this promise was never resolving (successfully or with an error) for some reason when we went from the
#/home
page to the#/overview
. I decided to try and remove the promises to make it easier to read and reason and that seemed to solve it for me, but I welcome someone else to try and reproduce this.Testing
x-pack
folder, load a sample archive:node ../scripts/es_archiver.js load monitoring/singlecluster-three-nodes-shard-relocation --kibana-url http://elastic:changeme@localhost:5601 --es-url http://elastic:changeme@localhost:9200
Clusters
in the top left and observe the infinite navigation loop