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

feat: Improve shutdown logic #1347

Merged
merged 1 commit into from
Sep 23, 2024
Merged

feat: Improve shutdown logic #1347

merged 1 commit into from
Sep 23, 2024

Conversation

kentquirk
Copy link
Contributor

Which problem is this PR solving?

  • If part of Refinery has a problem shutting down, there's no way to force it other than to do a kill -9, which is a pain.

Short description of the changes

  • Call the Stop() routines in the shutdown rather than in a defer()
  • Instead of simply blocking on the signal channel, monitor that channel in a goroutine. If more than one shutdown signal is received, exit immediately without trying to be clean about it.
  • Also, if a shutdown signal is received and the health system is already "not alive", just die immediately; there's a good chance the system won't be able to do an orderly shutdown.

@kentquirk kentquirk requested a review from a team as a code owner September 23, 2024 14:41
@kentquirk kentquirk changed the title Improve shutdown logic feat: Improve shutdown logic Sep 23, 2024
@kentquirk kentquirk merged commit 3294732 into main Sep 23, 2024
5 of 6 checks passed
@kentquirk kentquirk deleted the kent.safer_shutdown branch September 23, 2024 14:58
TylerHelmuth pushed a commit that referenced this pull request Oct 16, 2024
## Which problem is this PR solving?

- If part of Refinery has a problem shutting down, there's no way to
force it other than to do a `kill -9`, which is a pain.

## Short description of the changes

- Call the Stop() routines in the shutdown rather than in a defer()
- Instead of simply blocking on the signal channel, monitor that channel
in a goroutine. If more than one shutdown signal is received, exit
immediately without trying to be clean about it.
- Also, if a shutdown signal is received and the health system is
already "not alive", just die immediately; there's a good chance the
system won't be able to do an orderly shutdown.
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.

2 participants