To keep the architecture evolvable without sacrificing reliability, coordinate Readiness probes, preStop sleep, and HTTP keep-alive Connection: close headers.
TL;DR30-second simplified summary▾
Even when apps drain in-flight requests, long-lived HTTP keep-alive connections and async kube-proxy updates cause 502s. Flipping Readiness to 503, sleeping in preStop, and closing keep-alive sockets after active responses eliminates rollout errors.
Stage 1: Termination Lifecycle.
Why this matters: Establish termination lifecycle for Eliminating 502 Races in Rolling Deploys.
Think of Stage 1: Termination Lifecycle as the intuition layer for Eliminating 502 Races in Rolling Deploys: Establish termination lifecycle for Eliminating 502 Races in Rolling Deploys.
Stage 1: Termination Lifecycle establishes how Eliminating 502 Races in Rolling Deploys behaves under real production load.
Stage 1: Termination Lifecycle
Stage 2: Async Endpoint Race.
Why this matters: Establish async endpoint race for Eliminating 502 Races in Rolling Deploys.
Think of Stage 2: Async Endpoint Race as the intuition layer for Eliminating 502 Races in Rolling Deploys: Establish async endpoint race for Eliminating 502 Races in Rolling Deploys.
Stage 2: Async Endpoint Race establishes how Eliminating 502 Races in Rolling Deploys behaves under real production load.
Stage 2: Async Endpoint Race
- 502s during rolling updates
- ndots:5 DNS flood or OOMKill
- Unprotected node drains
- Zero-drop SIGTERM draining
- Bounded cgroup & conntrack
- Canary metrics gate rollout
- Problem
- How to implement Eliminating 502 Races in Rolling Deploys without hitting unbounded tail latency, state divergence, or operational fragility.
- Naive Solution
- Use a single unpartitioned path with unbounded retries and synchronous global coordination.
- Why It Fails
- Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
- Alternatives
- Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
- Engineering Decision
- To keep the architecture evolvable without sacrificing reliability, coordinate Readiness probes, preStop sleep, and HTTP keep-alive Connection: close headers.
- Trade-Offs
- Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
When Eliminating 502 Races in Rolling Deploys experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?
Stage 3: Naive SIGTERM.
Why this matters: Establish naive sigterm for Eliminating 502 Races in Rolling Deploys.
Think of Stage 3: Naive SIGTERM as the intuition layer for Eliminating 502 Races in Rolling Deploys: Establish naive sigterm for Eliminating 502 Races in Rolling Deploys.
Stage 3: Naive SIGTERM establishes how Eliminating 502 Races in Rolling Deploys behaves under real production load.
Stage 3: Naive SIGTERM
Stage 4: PreStop & Readiness.
Why this matters: Establish prestop & readiness for Eliminating 502 Races in Rolling Deploys.
Think of Stage 4: PreStop & Readiness as the intuition layer for Eliminating 502 Races in Rolling Deploys: Establish prestop & readiness for Eliminating 502 Races in Rolling Deploys.
Stage 4: PreStop & Readiness establishes how Eliminating 502 Races in Rolling Deploys behaves under real production load.
Stage 5: Keep-Alive Draining.
Why this matters: Establish keep-alive draining for Eliminating 502 Races in Rolling Deploys.
Think of Stage 5: Keep-Alive Draining as the intuition layer for Eliminating 502 Races in Rolling Deploys: Establish keep-alive draining for Eliminating 502 Races in Rolling Deploys.
Stage 5: Keep-Alive Draining establishes how Eliminating 502 Races in Rolling Deploys behaves under real production load.
Stage 5: Keep-Alive Draining
Stage 6: Grace Period Sizing.
Why this matters: Establish grace period sizing for Eliminating 502 Races in Rolling Deploys.
Think of Stage 6: Grace Period Sizing as the intuition layer for Eliminating 502 Races in Rolling Deploys: Establish grace period sizing for Eliminating 502 Races in Rolling Deploys.
Stage 6: Grace Period Sizing establishes how Eliminating 502 Races in Rolling Deploys behaves under real production load.
Stage 7: Rollout Telemetry.
Why this matters: Establish rollout telemetry for Eliminating 502 Races in Rolling Deploys.
Think of Stage 7: Rollout Telemetry as the intuition layer for Eliminating 502 Races in Rolling Deploys: Establish rollout telemetry for Eliminating 502 Races in Rolling Deploys.
Stage 7: Rollout Telemetry establishes how Eliminating 502 Races in Rolling Deploys behaves under real production load.
Practice: Make the trade-off yourself.
Why do 502s occur on SIGTERM (Check 1)?