diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 65ade7a49..ca9b5ee15 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -7,6 +7,12 @@ services: postgres: image: postgres:15.0-alpine container_name: mpcautofill_postgres + # client_connection_check_interval (Postgres 14+): probes the client socket + # periodically DURING query execution and aborts the query if the client is + # gone, rather than computing to completion for a dead client (issue #462). + # Deliberately NOT statement_timeout - BULK-mode eligibility scans legitimately + # run for minutes-hours with a live client and must not be killed. + command: postgres -c client_connection_check_interval=30000 ports: - "127.0.0.1:5432:5432" environment: diff --git a/docs/infrastructure.md b/docs/infrastructure.md index 856b9905c..681f6f440 100644 --- a/docs/infrastructure.md +++ b/docs/infrastructure.md @@ -107,6 +107,11 @@ this fixed and its follow-on hardening. Fixed by `eaece1fd` (#18, recreates the `django` container), also restart `nginx`** — see [[troubleshooting.md]] ("nginx 502s everything after a django container restart") for the mechanism and exact fix. +- **`client_connection_check_interval=30000`** (postgres `command:`, issue + #462) makes a backend abort its query if the client socket died mid-query + instead of computing to completion for nobody. Rollout requires one + deliberate `postgres` container recreate (seconds of DB downtime) — django + and the worker reconnect on their own, no restart needed for either. ### Boot-time recovery