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

[Feature]: add a Close method to App for graceful quit #16192

Closed
yihuang opened this issue May 17, 2023 · 1 comment · Fixed by #16193
Closed

[Feature]: add a Close method to App for graceful quit #16192

yihuang opened this issue May 17, 2023 · 1 comment · Fixed by #16193

Comments

@yihuang
Copy link
Collaborator

yihuang commented May 17, 2023

Summary

When the app has some asynchronous background tasks running, it might need a hook to cleanup resource gracefully before the node quit.
Specifically for the async commit proposal, we need this hook to wait for the background committer to finish, at least when the quit is a graceful one, like a panic in the upgrade module, so in these cases we don't lose data at all.
Although the async commit feature itself is blocked by current iavl implementation, but similar idea is implemented in memiavl already, so it'd be good to support the cleanup hook first.

Problem Definition

App can do some cleanups when quit gracefully.

Proposal

Add a Close method to BaseApp which is called in server start cmd, and the custom app can override.

@alexanderbez
Copy link
Contributor

Concept ACK 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants