fix(ready): bound the readiness DB ping at 3s #469
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-685-readiness-db-ping-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The readiness DB ping was unbounded, so a wedged connection could hold /api/v1/ready open past whatever timeout the orchestrator applies, and there was no documented budget for how slow a healthy
SELECT 1may be. Wrap it in a documented 3s bound: a cold pool or a loaded Postgres answers in ~1s and must still read as ready, while a truly unreachable database still fails the probe (now witherror: db ping exceeded 3sinstead of hanging). The ping future is passed tobounded_db_pingrather than the pool so the timeout path is unit testable on the virtual clock.tests/readiness.rswas also environment-dependent:just test-integrationruns inside the dev composeservercontainer, which always exports INFISICAL_BASE_URL while theinfisicalservice is an opt-in profile. The best-effort Infisical probe then failed against an absent host and the handler returned 503 after its 1s timeout (latency=1001 ms), which is what a probe run there looked like. Each /ready case now clears the variable before booting, so the suite's stated premise (Infisical unconfigured) holds regardless of the surrounding shell, single- or multi-threaded.#PMS-685