Skip to main content

Graceful Shutdown

AI Cost Firewall supports graceful shutdown on SIGTERM and SIGINT.

Sequence

  1. Signal received.
  2. /readyz returns 503.
  3. New requests are rejected.
  4. In-flight requests complete.
  5. Process exits after graceful_shutdown_timeout_seconds.
graceful_shutdown_timeout_seconds 10;

Rejection response

{
"error": {
"code": 503,
"message": "server is shutting down",
"type": "service_unavailable"
}
}

Metrics

aif_inflight_requests
aif_shutdown_in_progress
aif_shutdown_rejections_total