Let fx own signals and the exit code in the server example (closes #86)
check / check (push) Waiting to run

The lifecycle example computed an exit code that never reached os.Exit,
installed its own SIGINT/SIGTERM handler beside the one fx's Run()
installs, and exited from a goroutine when Sentry failed to start, so
no stop hook ran. Now only fx handles those signals; a listen error
asks fx to shut down with exit code 1 through fx.Shutdowner; Sentry's
error is returned from the server's start hook; and the server's stop
hook shuts the HTTP server down within 5 seconds and fails when
requests are still running. A new paragraph says who owns signals and
the exit code. SIGPIPE is still ignored, now in main.

Model: opus-5-5
This commit is contained in:
2026-10-04 08:15:17 +00:00
parent c43c1f4bca
commit a59b2b2cf6
2 changed files with 64 additions and 57 deletions
+9
View File
@@ -21,6 +21,15 @@ fmt-check, and commit.
# Completed Steps
- 2026-10-04: Fixed the server lifecycle example in
`prompts/GO_HTTP_SERVER_CONVENTIONS.md` (issue 86). Only fx handles SIGINT and
SIGTERM, and `Run()` in `main` exits with the shutdown's exit code. A listen
error asks fx to shut down with exit code 1 through `fx.Shutdowner`; a Sentry
start failure is returned from the server's start hook instead of calling
`os.Exit` from a goroutine, so the stop hooks of what had started still run.
The server's stop hook shuts the HTTP server down within 5 seconds and fails
when requests are still running. A new paragraph says who owns signals and the
exit code.
- 2026-10-04: `REPO_POLICIES.md` now says how a Go tool a repo needs on the host
is pinned (issue 37): installed with `go install` pinned to a commit hash,
never tracked as a `go.mod` tool dependency or through a `tools.go` file.