fix(api): add timeouts for OIDC discovery fetch and DB connection #66

Merged
Scrubs McBarkley merged 1 commits from fix/gro-1678-econnreset-robustness into dev 2026-05-24 20:11:44 +00:00

1 Commits

Author SHA1 Message Date
Flea Flicker dc3c23055a fix(api): add timeouts for OIDC discovery fetch and DB connection
CI / Test (pull_request) Successful in 16s
CI / Lint & Typecheck (pull_request) Successful in 19s
CI / Build & Push Docker Images (pull_request) Successful in 52s
- OIDC discovery fetch in initAuth() now has a 5s AbortSignal.timeout
  to fail fast instead of hanging indefinitely when the auth server is unreachable.
  This was identified as a root cause of startup ECONNRESET crashes on UAT
  where ztunnel drops TCP connections before headers arrive.

- DB postgres client now sets connect_timeout: 5 so failed connection attempts
  fail fast rather than hanging the startup sequence.

- Graceful shutdown timeout tightened to 8s (from 10s) to avoid
  getting killed by Kubernetes liveness-probe deadline while draining.

Fixes GRO-1678.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-24 19:46:23 +00:00