Skip to content

graceful shutdown on sigterm and sigint#56

Open
mooncitydev wants to merge 1 commit intoFastLane-Labs:mainfrom
mooncitydev:graceful-shutdown-signals
Open

graceful shutdown on sigterm and sigint#56
mooncitydev wants to merge 1 commit intoFastLane-Labs:mainfrom
mooncitydev:graceful-shutdown-signals

Conversation

@mooncitydev
Copy link
Copy Markdown

@mooncitydev mooncitydev commented Apr 15, 2026

what this fixes

the sidecar never called \Sidecar.Stop()\ from the main process. \systemctl stop, \docker stop, and other supervisors send SIGTERM; without handling that, the process did not cancel the txpool context, close the IPC connection, or stop the monitoring server in an orderly way.

changes

  • cmd/sidecar/main.go: register SIGINT and SIGTERM, call \sidecar.Stop()\ so the existing shutdown path runs (context cancel, IPC close, metrics cleanup, monitoring server stop).
  • internal/health/server.go: use \http.Server.Shutdown\ with a 10s timeout instead of \Close()\ so in-flight health/metrics requests can finish.

testing

go is not available in this environment; please run \go test ./...\ locally.


made by mooncitydev

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.

1 participant