Gateway: async healthcheck handler and explicit readiness probe timeout - #865
Closed
lorenzo-norcini-scale wants to merge 1 commit into
Closed
Gateway: async healthcheck handler and explicit readiness probe timeout#865lorenzo-norcini-scale wants to merge 1 commit into
lorenzo-norcini-scale wants to merge 1 commit into
Conversation
…meout A sync healthcheck handler runs in the anyio threadpool, so under load the /readyz probe queues behind blocked requests, misses the 1s default probe timeout, and k8s ejects pods that are saturated but healthy. Making the handler async keeps the probe on the event loop, and the probe timeout is now explicit (default 5s) and values-configurable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
|
Superseded by the consolidated incident-hardening PR: see the PR referencing this one. |
Collaborator
Author
|
Superseded by #868. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
healthcheck(serving/healthcheck,/healthz,/readyz) is nowasync def. As a sync handler it was dispatched to the shared anyio threadpool, so under load the readiness probe queued behind blocked requests and timed out while the app container was healthy.readinessProbenow sets an explicittimeoutSeconds(default 5, configurable viagateway.readinessProbeTimeoutSeconds). Previously unset, which means the Kubernetes default of 1s.Why
During the 2026-08-13 gateway incident, saturated but healthy pods failed the 1s probe and were ejected from the Service, concentrating load on the remaining pods (11 of 60 Ready at the worst point while ~40 app containers were healthy). The two changes remove that ejection mechanism: the probe no longer competes with request handling for threadpool slots, and the timeout tolerates transient event-loop delay.
Notes
timeoutSeconds: 5with default values.🤖 Generated with Claude Code
Greptile Summary
The PR moves the gateway health endpoints onto the async request path and gives Kubernetes readiness probes a configurable five-second timeout.
/healthcheck,/healthz, and/readyzhandler toasync def.gateway.readinessProbeTimeoutSecondsto the Helm values.Confidence Score: 5/5
The PR appears safe to merge, with the async handler and Helm timeout remaining aligned with the existing gateway readiness contract.
The registered health routes are awaited by the ASGI execution path, remain exempt from the application concurrency limiter, and the chart renders a valid five-second readiness timeout from its default values.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(gateway): async healthcheck handler ..." | Re-trigger Greptile
Context used: