{"version":"2.1.282","anchor":"gateway-readyz-grace-period-through-postgres-outages-and","canonical_anchor":"gateway-readyz-grace-period-through-postgres-outages-and","heading":"Self-hosted gateway: \/readyz can stay ready through Postgres outages, plus a load-test mode","tier":"use","area":"Self-Hosted Gateway","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.282\/e\/gateway-readyz-grace-period-through-postgres-outages-and","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.282","markdown":"### Self-hosted gateway: \/readyz can stay ready through Postgres outages, plus a load-test mode\n\nNew store.readiness_grace_seconds keeps the gateway's \/readyz ready through short Postgres outages, and a load_test_mode block serves canned replies\n\n**What**\n\nThe self-hosted gateway is the server bundled in the CLI. It logs 'upstream requests' limits and serves `\/readyz`, the address an orchestrator or load balancer checks to decide whether a copy of the server is ready for traffic. Before this release, `\/readyz` returned 503 \"store unavailable\" whenever its check of Postgres (the gateway's database) failed, and it logged nothing. This release adds:\n\n- `store.readiness_grace_seconds`: a new config key taking a whole number from 0 to 3600, default 0. When it is above 0, `\/readyz` keeps reporting ready for that many seconds after Postgres stops answering, then returns 503. During that time the gateway logs what happens to inference, which depends on `enforcement.fail_closed_on_error` (default false).\n\n- A warning at the default of 0: `\/readyz` still returns 503 immediately, but now logs a warning recommending the new key.\n\n- `load_test_mode`: a new config block with `enabled`, `reply_tokens` (default 750) and `reply_seconds` (default 9.5). It serves canned replies instead of calling the upstream.\n\n**Why**\n\nTo keep the gateway reporting ready through a short outage such as a database failover, set `store.readiness_grace_seconds` to more seconds than the outage lasts, up to 3600. Otherwise one Postgres blip can make every replica report not ready at once, and the load balancer or orchestrator may pull them all. Check `enforcement.fail_closed_on_error` to know how requests are treated during the grace period. The load-test mode lets you exercise the gateway without sending requests upstream.\n\n- Area: Self-Hosted Gateway\n- Names: `store.readiness_grace_seconds`, `enforcement.fail_closed_on_error`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5"}