fix(ops): дрилл восстановления ждал БД по сокету и умирал на старте настоящего сервера #3026

Merged
lekss361 merged 1 commit from fix/2203-restore-drill-readiness into main 2026-08-21 17:12:00 +00:00

View file

@ -113,7 +113,15 @@ log "Container up, mapped to 127.0.0.1:${host_port} (only reachable while this d
log "Waiting for postgres to accept connections (timeout ${READY_TIMEOUT}s)..."
ready=0
for _ in $(seq 1 "$READY_TIMEOUT"); do
if docker exec "$CONTAINER" pg_isready -U postgres >/dev/null 2>&1; then
# -h 127.0.0.1 is load-bearing, NOT cosmetic. The postgres image runs a
# TEMPORARY server during initialisation, and that server already answers
# "accepting connections" on the unix socket. Probing the socket therefore
# goes green mid-init; the restore starts against the temporary server and
# dies with "FATAL: terminating connection due to administrator command"
# the moment the entrypoint shuts it down to start the real one. The
# temporary server does NOT listen on TCP, so a TCP probe only goes green
# on the real server. Same reasoning, same fix as ci-tradein.yml:137-141.
if docker exec "$CONTAINER" pg_isready -h 127.0.0.1 -U postgres >/dev/null 2>&1; then
ready=1
break
fi