fix(cfold): wait for ghost db in entrypoint
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing

This commit is contained in:
autonomic-bot
2026-06-13 03:58:51 +00:00
parent 5004b32cfb
commit d44f799de9

View File

@ -30,16 +30,23 @@
# applies on both (persists untracked across the head checkout) — a recipe-PR candidate too.
# Grace-only; masks no defect; weakens no test.
#
# The app also needs a LONGER restart delay during the base→head crossover. On current Ghost heads the
# upgrade concurrently replaces mysql 8.0 with mysql 8.4; swarm starts a new app task before the new
# db service name is resolvable/ready, so Ghost exits immediately with `ENOTFOUND <stack>_db` and the
# rolling update pauses before the next retry. A 15s delay makes the retried app start after mysql is
# back, which preserves the real upgrade/assertion while removing a transient service-discovery race.
# The app also needs a DB-ready wait during the base→head crossover. On current Ghost heads the
# upgrade concurrently replaces mysql 8.0 with mysql 8.4; swarm starts the new app task before the
# replacement db service is accepting connections, so Ghost exits immediately with
# `ENOTFOUND`/`ECONNREFUSED` against `${STACK_NAME}_db` and swarm pauses the rolling update BEFORE any
# delayed retry can help. Wrapping the app command with a tiny TCP-ready wait preserves the real
# upgrade/assertion while removing this transient service-ordering race.
services:
app:
deploy:
restart_policy:
delay: 15s
entrypoint:
- sh
- -ec
- |
host="$$database__connection__host"
until node -e 'const net=require("net"); const host=process.argv[1]; const socket=net.connect({host, port: 3306}, () => { socket.end(); process.exit(0); }); socket.on("error", () => process.exit(1)); setTimeout(() => process.exit(1), 1000);' "$$host"; do
sleep 2
done
exec /abra-entrypoint.sh node current/index.js
healthcheck:
start_period: 15m
db: