Merge pull request 'fix(ops): дрилл восстановления ждал БД по сокету и умирал на старте настоящего сервера' (#3026) from fix/2203-restore-drill-readiness into main
Some checks failed
Deploy / build-backend (push) Blocked by required conditions
Deploy / build-worker (push) Blocked by required conditions
Deploy / build-frontend (push) Blocked by required conditions
Deploy / deploy (push) Blocked by required conditions
Deploy / deploy-caddy (push) Blocked by required conditions
Deploy / perimeter-smoke (push) Blocked by required conditions
Deploy / deploy-status (push) Blocked by required conditions
Deploy / changes (push) Has been cancelled
Some checks failed
Deploy / build-backend (push) Blocked by required conditions
Deploy / build-worker (push) Blocked by required conditions
Deploy / build-frontend (push) Blocked by required conditions
Deploy / deploy (push) Blocked by required conditions
Deploy / deploy-caddy (push) Blocked by required conditions
Deploy / perimeter-smoke (push) Blocked by required conditions
Deploy / deploy-status (push) Blocked by required conditions
Deploy / changes (push) Has been cancelled
This commit is contained in:
commit
1202804268
1 changed files with 9 additions and 1 deletions
|
|
@ -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)..."
|
log "Waiting for postgres to accept connections (timeout ${READY_TIMEOUT}s)..."
|
||||||
ready=0
|
ready=0
|
||||||
for _ in $(seq 1 "$READY_TIMEOUT"); do
|
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
|
ready=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue