-
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
[pluginSystem] optimize plugins stop execution #164831
Conversation
Pinging @elastic/kibana-core (Team:Core) |
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.
LGTM. I just added 1 nit
|
||
this.log.debug(`Stopping plugin "${pluginName}"...`); | ||
// Stop plugin as soon as all the dependant plugins are stopped. | ||
const pluginStopPromise = Promise.all(dependantPromises).then(async () => { |
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.
nit: should we use Promise.allSettled
instead?
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.
Old behavior was to throw on first error, so I just kept it tbh. It may be better to wait for everything, but I was kinda scared to change.
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.
The only difference is that now we are running multiple stops at the same time. So we may cancel ongoing promises.
IMO, it's OK not to continue calling other stops
, but I feel uneasy cancelling running calls (despite our stop is not guaranteed to be called policy).
Happy to merge as is, though.
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.
Fair point. it would be a bit challenging to only cancel the running promises and would over complexify the flow. I will adapt to wait for everything instead and use allSettled
👍
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Related to #163519
Optimize the way we're shutting down plugins, by calling
stop
for each plugin as soon as all dependant plugins are stopped, instead of just doing it one-by-one.