Skip to content

supervisor: the old pod's self-drain calls the Envoy admin on 127.0.0.1:9901 without checking it is its own Envoy — it drained the NEW pod's freshly started Envoy, which then served no new listeners #1127

Closed

Description

@bpalermo

Found in the 2026-10-01 4→2 worker rollout (#1126). After the successor crashed and the new pod's supervisor started Envoy from scratch (epoch 0), the OLD pod's supervisor hit its no successor within budget; draining listeners path (w01 21:30:47Z, w03 21:31:08Z). Its own Envoy had already closed its admin interface (w01 21:27:57, w03 21:28:18), and the proxy pods are hostNetwork, so the drain request to 127.0.0.1:9901 most likely reached the new pod's Envoy. From then on that Envoy added no listeners for newly created pods (the agent generated them; other nodes added them in 1–4 s): ~12 minutes of dial: i/o timeout for the new k6 pods (4,320 + 4,680 failures), connection refused on 18081 for the new probers, and agent health gateway unreachable, until the next handoff replaced that Envoy. w01 and w03 are exactly the nodes where the from-scratch Envoy started before the old supervisor's self-drain; on w05 it started after, on w02 the old pod was killed instead. (Mechanism inferred from the timeline, not yet reproduced.)

Fix: every supervisor admin call that mutates state (drain listeners, healthcheck/fail, quit) must first confirm the target is its own Envoy — compare pid / hot-restart epoch / a per-pod nonce from /server_info (the epoch-identity probe in hotrestart/adminprobe.go already does this for the takeover check) — and skip the call when it is not. Test: unit test with a fake admin answering a foreign epoch (seen red), and a kind leg: kill the successor during a handoff so the new pod starts fresh while the old pod is in its termination wait; assert the new Envoy keeps accepting LDS updates.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions