Run the test PostgreSQL behind an init and let pg_isready give up before Docker (refs #98)
ci / test (postgres) (pull_request) Skipped
ci / image (pull_request) Waiting for needed jobs
ci / test (postgres) (push) Successful in 23m7s
ci / image (push) Skipped

The server log of a failing job shows every restart as 'untracked child
process exited with exit code 2'. A health check that outlives its 3-second
timeout leaves pg_isready to PostgreSQL, which is PID 1 in its container;
when pg_isready exits the postmaster takes it for a crashed backend and
restarts every connection. --init reaps such orphans, and pg_isready -t 5
under a 15-second timeout is never cut off. Same change in docker-compose.yml.
ADR 0015.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-15 13:03:44 +01:00
1 parent 72f4cbe0a5
commit 6ea303e1dc
4 files changed
+58 -5

No files matched your search

+5 -2
View File
@@ -24,10 +24,13 @@ jobs:
POSTGRES_DB: anubis
POSTGRES_USER: anubis
POSTGRES_PASSWORD: anubis-ci
# --init and a pg_isready that gives up before Docker does (ADR 0015, issue #98). Without them a health
# check that outlives its timeout leaves pg_isready to PostgreSQL as PID 1, and its exit restarts the server.
options: >-
--health-cmd "pg_isready -U anubis -d anubis"
--init
--health-cmd "pg_isready -U anubis -d anubis -t 5"
--health-interval 3s
--health-timeout 3s
--health-timeout 15s
--health-retries 20
env:
ANUBIS_TEST_DB: ${{ matrix.db }}