The forge server and the CI daemon now answer /ready beside /health
BRUTAL runs as a forge server and a separate CI daemon. Both keep /health unchanged; it reports liveness only. A new GET /ready answers 200 (ready) or 503 (notReady) with one list of checks. Each check has a name, a status (ok, failed, notApplicable or skipped) and a fixed reason text.
The forge server checks that its storage roots are readable and writable, without writing anything, that the identity provider's OpenID discovery document is reachable and names the configured issuer, that the service credential opens every encrypted repository, and that every writer lock can be reached with one non-blocking try-lock. The CI daemon checks that its controller answers a read bounded to 3 s, that no lease of a job attempt expired without recovery, and that the configured Docker context answers docker version. A check that does not apply to the running mode reports notApplicable and does not fail readiness; skipped means that a check it depends on already failed.
All probes within about 2 s share one evaluation with an 8 s deadline, so a storm of probes costs one evaluation and a hung check is never started twice. In the tests, 100 concurrent probes cost one evaluation, and at 100 probes per second the repository writer never waited behind them. The reasons are static strings, so an answer carries no secret, path, repository, subject or host name.
One full source check of the branch, in parallel lanes, was green: 53 times test result: ok, 0 failed, all 35 source steps passed. All 19 new tests ran and passed on Linux. When an initialized repository does not open, the writer lock check reports skipped, not ok, because its lock was never probed. A readiness counter is left as a follow-up.
Sources
- #172 0b73d8c