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

Root should handle its shutdown state #110677

Closed
afharo opened this issue Aug 31, 2021 · 3 comments
Closed

Root should handle its shutdown state #110677

afharo opened this issue Aug 31, 2021 · 3 comments
Labels
bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@afharo
Copy link
Member

afharo commented Aug 31, 2021

The Root class calls this.shutdown(e) when any of the lifecycle steps breaks. This allows us to gracefully shutdown Kibana when any of those steps throw an error.

The problem is that it's also called externally when a SIGTERM or SIGINT signal are emitted. So there's the possibility that we receive that signal while Kibana is still processing requests from any of its lifecycle steps.

This is causing that a signal that should make Kibana exit 0, might end up logging FATAL Error while still exiting 0 if any of the lifecycle steps throws when a condition is not met (i.e.: ES connection is closed prematurely or never properly opened yet).

IMO, we should handle the state (and potentially cancel the promises) on the first shutdown call. This can be done either in the Root class or the bootstrap.ts logic

@afharo afharo added bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Operations Team label for Operations Team labels Aug 31, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@afharo afharo changed the title Root should handle its state Root should handle its shutdown state Aug 31, 2021
@tylersmalley tylersmalley removed the Team:Operations Team label for Operations Team label Aug 31, 2021
@pgayvallet
Copy link
Contributor

Fixed by #161869, closing

pgayvallet added a commit that referenced this issue Nov 2, 2023
## Summary

Fix #109684

Most of the work was already done in
#110677, this PR just remove a
deprecated call to `toPromise()`, a better error message and a unit test
to assert the behavior.
delanni pushed a commit to delanni/kibana that referenced this issue Nov 6, 2023
…70309)

## Summary

Fix elastic#109684

Most of the work was already done in
elastic#110677, this PR just remove a
deprecated call to `toPromise()`, a better error message and a unit test
to assert the behavior.
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 Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

4 participants