Skip to content

shut down gracefully on SIGTERM and exit on a second signal - #46

Merged
thirdeyenick merged 1 commit into
mainfrom
signal-handling
Oct 29, 2026
Merged

thirdeyenick merged 1 commit into
mainfrom
signal-handling

Conversation

@thirdeyenick

Copy link
Copy Markdown
Contributor

The embedded NATS server handled SIGINT and SIGTERM itself and exited the process once NATS was stopped, so kigeon's graceful shutdown was cut short on every termination. NATS no longer handles signals (NoSigs).

kigeon now waits for signals with signal.NotifyContext and restores the default signal handling once the shutdown started, so a second signal terminates kigeon immediately instead of waiting for the shutdown to complete. The components are still stopped in order before their context is canceled.

@thirdeyenick
thirdeyenick merged commit 19bb151 into main Oct 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant