fix(gateway): self-heal upstream after backend pod rollout (v1.0.11)#7
Merged
Conversation
added 2 commits
June 22, 2026 16:56
…service name image-app-publish names the Ingress and Service identically, so the ns-ingress-svc key doubled (default-arche-arche). Already live in the deployed gateway — committing so the released build matches production.
Root cause: hyper's idle connection pool is keyed by hostname, not resolved IP, with a 90s idle timeout > 30s passive-health recovery_time. After a backend Deployment rolls (new pod IP), pooled sockets to the dead old pod IP linger and get reused -> SendRequest fails -> backend marked unhealthy -> the half-open probe reuses another stale socket -> permanent 503 'No healthy backends' until the gateway is restarted. Fix: pool_idle_timeout 90s->5s + TCP keepalive 90s->15s (evict stale sockets before the recovery probe) and passive-health recovery_time 30s->10s. The 5s<10s invariant guarantees the half-open probe opens a FRESH connection that re-resolves DNS to the new pod IP, so the gateway self-heals within ~10s of a rollout instead of needing a manual restart.
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.
Headline: hyper's idle connection pool is keyed by hostname (not resolved IP) with a 90s idle timeout > 30s passive-health recovery_time. After a backend pod rolls (new IP), pooled sockets to the dead pod IP get reused → SendRequest fails → backend marked unhealthy → half-open probe reuses another stale socket → permanent 503 until gateway restart. Fix: pool_idle_timeout 90→5s, TCP keepalive 90→15s, recovery_time 30→10s (5s<10s invariant → probe always re-resolves to the new pod IP → self-heals ~10s). Also commits the route-key de-dup (live in prod, never committed). Bumps to v1.0.11. cargo check clean.