Why Zero-Downtime Deploys Still Drop Requests in Practice
An investigation into the four subtle failure modes that cause 502s, broken asset chunks, and severed streams during 'atomic' rollouts—and how we fixed them.
Almost every deployment platform advertises "zero-downtime deploys." In practice, if you point a continuous load tester at most blue-green or rolling deploy pipelines and push ten releases in an hour, you will usually spot a small cluster of 502s, 404s on JS chunks, or prematurely closed streams right around the cutover timestamp.
Users rarely report a single dropped request out of 50,000, so these glitches survive for years. During our work on Weond's atomic rollback engine, we ran continuous canary probes (200 req/sec, including SSE streams and multi-step SPA navigations) across 500 consecutive deploys to catalog every failure mode that actually showed up.
Here is what broke, why it broke, and the exact sequence that eliminated cutover errors.
The four cutover failure modes we observed
Across the first 100 test deploys, 14 releases produced at least one client-visible error despite every health check passing. Grouping the failures revealed four distinct causes:
| Failure Mode | Frequency (per 100 deploys) | Client Symptom | Root Cause |
|---|---|---|---|
| Premature container stop | 7 | 502 Bad Gateway |
Old worker killed before edge route cache expired |
| Chunk version skew | 4 | 404 on lazy JS bundle |
Old index.html requested hashed asset deleted in new release |
| Unfinished SSE drain | 2 | Stream reset mid-event | Hard SIGKILL after short 2s grace window |
| Cold-route health race | 1 | 503 Service Unavailable |
/healthz passed on loopback before listener bound externally |
None of these were bugs in user application code. All four were coordination bugs between the builder, the edge router, and the runtime supervisor.
1. The route propagation gap
The most common failure happened even when the new release was completely healthy. The control plane updated the database pointer to release_42, emitted a webhook to edge nodes, and immediately sent SIGTERM to release_41.
Because edge nodes poll and apply route snapshots asynchronously (typically within 150–400 ms), any request arriving at an edge node during that 400 ms window was still routed to release_41—whose socket was already closed.
A deploy is only atomic if the old target remains reachable for longer than the worst-case propagation delay across every edge node, plus the maximum in-flight request duration.
Our fix was straightforward: decouple promotion from teardown. When release_42 passes health checks, the edge router flips immediately, but release_41 enters a 30-second draining state where it accepts no new routes yet continues serving any straggler requests or open streams until they finish cleanly.
2. Asset skew on single-page applications
The second failure mode only surfaced when we tested real browser sessions rather than curl. A user loads index.html from release_41, reads the page for two minutes, and clicks a route that dynamically imports /assets/settings-9a2f1c.js.
If release_42 replaced the static directory in place, /assets/settings-9a2f1c.js no longer exists on disk and the browser throws an unhandled chunk-load error.
Instead of overwriting a mutable dist/ folder, Weond stores each build as an immutable content-addressed artifact and serves /assets/* with a 24-hour overlap window against the previous release manifest. HTML entrypoints always resolve to the active release immediately, while hashed static chunks from the prior release remain readable for active browser tabs.
3. Verifying what real traffic actually hits
Our early health probe only checked GET /healthz over localhost. That missed two real-world issues:
- Misconfigured SSR adapters that returned
200 OKon/healthzwhile failing on/because an environment variable was missing. - Workers that bound to
127.0.0.1instead of the container bridge interface.
We changed the pre-cutover probe to exercise the exact upstream socket path the edge proxy will use, validating both TCP readiness and HTTP response framing before flipping the active pointer:
build artifact (rel_042)
└─► stage runtime on isolated socket
└─► edge-path probe (status + framing check)
├─ fail ──► abort release, keep rel_041 live
└─ pass ──► atomic pointer swap (rel_041 → rel_042)
└─► drain rel_041 (30s grace window)
4. What this means for one-click rollbacks
An unexpected benefit of immutable artifacts and decoupled teardown is that rollbacks stop being a special case. Rolling back from rel_042 to rel_041 does not re-run npm install or rebuild a container; it runs the exact same probe-and-swap state machine against an archived artifact that already exists.
In our 500-deploy verification run after these changes:
- Total requests sent: 1,840,000 across 500 consecutive deploys and 50 forced rollbacks.
- 502 / 503 cutover errors:
0. - SPA chunk 404s during active sessions:
0. - Median rollback cutover time:
380 msfrom click to global edge confirmation.
Zero-downtime deployment is rarely solved by a single clever tool. It is mostly disciplined bookkeeping: never delete what a client might still be reading, never kill what an edge node might still be routing to, and always verify the path real traffic actually takes.