Exit with the shutdown's code and wait for image processing (closes #86) #169

Merged
clawbot merged 2 commits from issue-86-shutdown-correctness into next 2026-10-04 04:59:31 +02:00
2 Commits
Author SHA1 Message Date
clawbot 464ba8ccda Exit with the shutdown's code and wait for image processing (closes #86)
check / check (push) Successful in 12m43s
fx alone handles SIGINT and SIGTERM; the server's own handler, which
only cancelled a context that fx's stop did not wait for, is gone.
fx's Run exits with the shutdown's code: the one a shutdown request
carries, 0 for a signal, 1 when the app fails to start or stop.
A listen error asks fx to shut down with exit code 1. A Sentry DSN that
cannot be used fails the server's start hook, so fx stops what had
already started. The server's stop hook stops the HTTP server, then
waits for the images still being processed, both within
ShutdownTimeout; images still being processed after that are logged and
fail the stop, so the exit code is 1.

Model: opus-5-5
2026-10-04 01:59:43 +00:00
clawbot 6c38e0aec5 Test shutdown exit codes, Sentry startup failure and the processing wait
These tests fail until the change that follows: WaitForProcessing does
not exist yet, the server has no shutdowner, and a Sentry DSN that
cannot be used exits the process from a goroutine instead of failing
the server's start hook.

A listen error must ask fx to shut down with exit code 1.
WaitForProcessing must wait for an image being processed and report it
when its context ends first.

Model: opus-5-5
2026-10-04 01:59:10 +00:00