CLIEntry in internal/routewatch/cli.go registers its own SIGINT and SIGTERM handler with signal.Notify in a start hook and calls shutdowner.Shutdown() from it, on top of fx's own handling of the same signals. GO_HTTP_SERVER_CONVENTIONS.md ("Signal Handling and Graceful Shutdown") says fx owns SIGINT, SIGTERM and the exit code, and no other code calls signal.Notify.
Failure scenario: on docker stop, both fx and this handler see SIGTERM. When fx is already shutting down, the second Shutdown() call returns an error and the daemon logs "Failed to shutdown gracefully" on a clean stop, which reads as a failure in the deploy log. The handler goroutine also outlives the stop.
internal/routewatch/cli.go no longer calls signal.Notify; fx alone handles SIGINT and SIGTERM, as the convention says.
A test, failing before the fix, or a check of the built image: a stop signal shuts the daemon down once, logs no "Failed to shutdown gracefully", and the process exits 0.
make check passes.
Model: opus-5-5
`CLIEntry` in `internal/routewatch/cli.go` registers its own SIGINT and SIGTERM handler with `signal.Notify` in a start hook and calls `shutdowner.Shutdown()` from it, on top of fx's own handling of the same signals. `GO_HTTP_SERVER_CONVENTIONS.md` ("Signal Handling and Graceful Shutdown") says fx owns SIGINT, SIGTERM and the exit code, and no other code calls `signal.Notify`.
Failure scenario: on `docker stop`, both fx and this handler see SIGTERM. When fx is already shutting down, the second `Shutdown()` call returns an error and the daemon logs "Failed to shutdown gracefully" on a clean stop, which reads as a failure in the deploy log. The handler goroutine also outlives the stop.
Found while fixing https://git.eeqj.de/sneak/routewatch/issues/100.
Severity: low
## Definition of done
- `internal/routewatch/cli.go` no longer calls `signal.Notify`; fx alone handles SIGINT and SIGTERM, as the convention says.
- A test, failing before the fix, or a check of the built image: a stop signal shuts the daemon down once, logs no "Failed to shutdown gracefully", and the process exits 0.
- `make check` passes.
Model: opus-5-5
clawbot
self-assigned this 2026-10-20 01:17:49 +02:00
#135 removes the start hook's own SIGINT and SIGTERM handler, so fx alone handles both. The failure line this issue describes does not show up on a clean stop with fx v1.24.0; the PR body says why and how the change was checked instead.
Model: opus-5-5
https://git.eeqj.de/sneak/routewatch/pulls/135 removes the start hook's own SIGINT and SIGTERM handler, so fx alone handles both. The failure line this issue describes does not show up on a clean stop with fx v1.24.0; the PR body says why and how the change was checked instead.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
CLIEntryininternal/routewatch/cli.goregisters its own SIGINT and SIGTERM handler withsignal.Notifyin a start hook and callsshutdowner.Shutdown()from it, on top of fx's own handling of the same signals.GO_HTTP_SERVER_CONVENTIONS.md("Signal Handling and Graceful Shutdown") says fx owns SIGINT, SIGTERM and the exit code, and no other code callssignal.Notify.Failure scenario: on
docker stop, both fx and this handler see SIGTERM. When fx is already shutting down, the secondShutdown()call returns an error and the daemon logs "Failed to shutdown gracefully" on a clean stop, which reads as a failure in the deploy log. The handler goroutine also outlives the stop.Found while fixing #100.
Severity: low
Definition of done
internal/routewatch/cli.gono longer callssignal.Notify; fx alone handles SIGINT and SIGTERM, as the convention says.make checkpasses.Model: opus-5-5
#135 removes the start hook's own SIGINT and SIGTERM handler, so fx alone handles both. The failure line this issue describes does not show up on a clean stop with fx v1.24.0; the PR body says why and how the change was checked instead.
Model: opus-5-5