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

[Fix] Handle more POSIX signals on UNIX systems #3102

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Feb 19, 2024

This PR extends the signal handler on UNIX; in addition to SIGINT, it now also supports SIGTERM, SIGQUIT, and SIGHUP.

@ljedrz ljedrz requested a review from howardwu February 19, 2024 13:12
@ljedrz ljedrz marked this pull request as draft February 19, 2024 13:38
@ljedrz ljedrz marked this pull request as ready for review February 19, 2024 14:12
Signed-off-by: ljedrz <ljedrz@gmail.com>
Copy link
Contributor

@iamalwaysuncomfortable iamalwaysuncomfortable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to bump up the number of seconds waiting for the shutdown? Even if there are SIGINT signals, a 3 second wait time might not be enough to clean everything up.

Maybe something like

tokio::time::sleep(Duration::from_secs(10)).await;

@ljedrz
Copy link
Collaborator Author

ljedrz commented Feb 19, 2024

@iamalwaysuncomfortable what cleanups do you have in mind? Anything that's not (persistent) storage-related doesn't really require any special treatment.

@howardwu
Copy link
Contributor

Adding a note for context here:

SIGTERM terminates the process gracefully
SIGQUIT terminates the process with a core dump
SIGKILL immediately and forcefully terminates the process; it can't be caught
SIGSTP suspends execution
SIGSTOP suspends execution and can't be caught
SIGHUP can be received when the owning terminal is shut down; it can be worked around on UNIXes with nohup or disown
SIGABRT terminates the process as if it was done from within the process

@howardwu howardwu merged commit d8a8e70 into AleoNet:mainnet Feb 20, 2024
23 of 24 checks passed
@howardwu howardwu changed the title Handle more POSIX signals on UNIX systems [Fix] Handle more POSIX signals on UNIX systems Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants