Skip to content

fix(selfhost): add a healthcheck to the pgbouncer service #2503

Description

@JSONbored

Parent: #1936

Problem

The pgbouncer service in docker-compose.yml has no healthcheck: block at all, so nothing can gate on pooler readiness even though the app is instructed to point DATABASE_URL at pgbouncer:5432 under --profile pgbouncer.

Combined with the missing gittensory -> pgbouncer depends_on entry (tracked separately), a --profile pgbouncer deployment has no readiness signal for the actual DB endpoint the app connects to; the app can only detect failure by having its Postgres connection attempts fail/retry against pgbouncer, with no compose-level ordering or crash-loop protection specific to the pooler layer.

Fix

Add a lightweight healthcheck to pgbouncer (e.g. pg_isready -h 127.0.0.1 -p 5432 or a TCP probe) and wire it into gittensory's depends_on alongside the postgres fix (see the companion depends_on issue).

Verification

  • Confirm current pgbouncer service block against docker-compose.yml (line numbers may have shifted).
  • docker compose --profile pgbouncer ps shows a health status for pgbouncer, not "no healthcheck".

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions