From 142b54158e8b0c16000756c93b86bbd4b28a8f50 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 6 Aug 2026 16:22:22 -0500 Subject: [PATCH] docs: graceful shutdown docs Considered the explanations and use cases on: - https://github.com/yesodweb/wai/issues/853 - https://github.com/PostgREST/postgrest/pull/4580 --- docs/postgrest.dict | 2 ++ docs/references/http_server.rst | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/postgrest.dict b/docs/postgrest.dict index f8120a407..db69caaa6 100644 --- a/docs/postgrest.dict +++ b/docs/postgrest.dict @@ -1,5 +1,6 @@ personal_ws-1.1 en 0 utf-8 api +autoscaling API's APIs APISIX @@ -34,6 +35,7 @@ DevOps Dramatiq dockerize enum +ECS Enums Entra eq diff --git a/docs/references/http_server.rst b/docs/references/http_server.rst index 27362f5e2..c28449e51 100644 --- a/docs/references/http_server.rst +++ b/docs/references/http_server.rst @@ -4,3 +4,15 @@ HTTP Server ########### The HTTP server is provided by `Warp `_. + +Graceful shutdown +----------------- + +PostgREST uses Warp's graceful shutdown, when a ``SIGTERM`` is received: + +- It stops accepting new requests. +- Allows requests that are already in progress to finish. +- Closes idle ``Keep-Alive`` connections instead of waiting for them to expire. +- Responses sent during shutdown indicate that the connection should not be reused (e.g. for HTTP/1.x, it sends ``Connection: close``). + +This allows PostgREST to shut down promptly without interrupting in-flight requests. Useful for zero-downtime upgrades and autoscaling/load-balancing under cloud environments (AWS ECS, Kubernetes).