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

Try to shut down more aggressively #82

Merged
merged 1 commit into from
Feb 17, 2024
Merged

Try to shut down more aggressively #82

merged 1 commit into from
Feb 17, 2024

Conversation

theory
Copy link
Member

@theory theory commented Feb 17, 2024

Add a separate shutdown method called by run and by signal handlers. It's responsible for removing the PID file and for setting continue to 0. This should ensure that it's always called at least once, and is safe to call multiple times. Either way the PID file should now always be deleted and the shutdown activity properly logged.

Also set all the signal handlers in the _signal_handlers method, and teach it to nest signal handlers if necessary. This will keep the consumer from wiping out its own handlers. I have no reason to think they have been, but it seems best to play it as safe as possible.

Add a slew of new tests to test all these behaviors thoroughly.

@theory theory self-assigned this Feb 17, 2024
Add a separate `_shutdown` method called by `run` and by signal
handlers. It's responsible for removing the PID file and for setting
`continue` to `0`. This should ensure that it's always called at least
once, and is safe to call multiple times. Either way the PID file should
now always be deleted and the shutdown activity properly logged.

Also set all the signal handlers in the `_signal_handlers` method, and
teach it to nest signal handlers if necessary. This will keep the
consumer from wiping out its own handlers. I have no reason to think
they have been, but it seems best to play it as safe as possible.

Add a slew of new tests to test all these behaviors thoroughly.
@theory theory merged commit 2084b09 into main Feb 17, 2024
10 checks passed
@theory theory deleted the signal-pid branch February 17, 2024 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant