Skip to content

Handle SIGINT/SIGTERM to allow graceful shutdown#28

Merged
annervisser merged 1 commit intomainfrom
handle-interrupt-signals
Feb 10, 2026
Merged

Handle SIGINT/SIGTERM to allow graceful shutdown#28
annervisser merged 1 commit intomainfrom
handle-interrupt-signals

Conversation

@annervisser
Copy link
Member

Problem

The breakpoint CLI ignored interrupt signals (SIGINT/SIGTERM) because the root context was a plain context.Background() with no signal handling. This meant Ctrl+C and GitHub Actions cancellation had no effect — the process would keep running until the timer expired.

Fix

Use signal.NotifyContext in main.go to cancel the root context on SIGINT and SIGTERM. This propagates through all subcommands (wait, hold, etc.) via their <-ctx.Done() selects.

The root context was created with context.Background() and no signal
handling, so interrupt signals (Ctrl+C, GitHub Actions cancellation)
were ignored. Use signal.NotifyContext to cancel the context on SIGINT
and SIGTERM, allowing all subcommands to shut down gracefully.

Also update authorized-users list in CI workflows.

Amp-Thread-ID: https://ampcode.com/threads/T-019c47f1-15d3-72ff-bdbd-9148e7131838
Co-authored-by: Amp <amp@ampcode.com>
@annervisser annervisser requested a review from n-g February 10, 2026 14:44
@annervisser annervisser merged commit 2461acd into main Feb 10, 2026
1 check passed
@annervisser annervisser deleted the handle-interrupt-signals branch February 10, 2026 16:40
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