You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proxy: Envoy segfaults in HotRestartingChild::onForwardedUdpPacket when the successor has fewer workers than the parent (4→2 hot restart, 'Mismatched worker index') #1126
Found during the #1093 A/B on talos-main, 2026-10-01 (main 231498f, chart 2.2.0, knob from #1125).
Sequence: helm upgrade --set proxy.concurrency=2 rolled the proxy DaemonSet at ≈21:17–21:33Z — one hot-restart handoff per node from a 4-worker parent to a 2-worker child. A fresh k6 runner was created at 21:33:03Z. On two of the five loaders, requests to svc-1/svc-2 then failed with dial: i/o timeout (k6 code 1211) at a steady ~6/s from 21:33:43Z; totals 4,320 and 4,680 failures, i.e. ≈12 minutes, ending at the next proxy roll (21:44:24–21:46:39Z, a 2→2 handoff). The other three loaders: 0 failures. The three later 2→2 rolls: 0 failures.
So the mixed-worker-count handoff left those two nodes in a state where a share of new TCP connections to the capture path was never accepted, and it persisted after the 4-worker parent had exited — much worse than the "a few connections in the accept queues" the knob's comment (and ExtraArgs in hotrestart/supervisor.go) warns about. Hypothesis: reuse-port listen sockets for worker indices 2–3 inherited or left open without an accepting worker (per-pod capture listeners in the pod netns, incl. listeners added by LDS for pods created after the handoff), so the kernel keeps hashing SYNs to them.
Until understood: do not change proxy.concurrency on a live mesh (default 0 = one worker per core is unaffected). To do: reproduce on kind (helm upgrade --set proxy.concurrency=2, then create a pod and dial through capture; ss -ltnp per netns to count listen sockets vs workers), find where the extra sockets live (supervisor's cross-pod handoff / Envoy socket inheritance by worker index at the pinned version + carried patches), and either make the transition safe (close surplus sockets after the handoff; or force a full restart instead of a hot restart when the count changes) or make the chart refuse a change without an explicit acknowledgement. Evidence: session scratchpad quic-measure/k6-e2e-20261001T213303Z-*.prev.log, ab3-1093.log.
changed the title [-]proxy: changing proxy.concurrency on a live mesh black-holed ~10% of new connections from freshly created pods on 2 of 5 nodes until the next same-count restart[/-][+]proxy: Envoy segfaults in HotRestartingChild::onForwardedUdpPacket when the successor has fewer workers than the parent (4→2 hot restart, 'Mismatched worker index')[/+]on Oct 1, 2026
Root cause corrected (analysis of the 2026-10-01 4→2 rollout from the logs)
My orphaned-reuse-port-socket hypothesis above was wrong. What happened:
The 2-worker successor crashed (segfault) in HotRestartingChild::onForwardedUdpPacket, right after Mismatched worker index. expected 3, actual 1 (and expected 2, actual 0). The parent forwards QUIC/UDP datagrams tagged with ITS worker index (0–3); a child with 2 workers has no worker 2 or 3. Crash counts during the rollout: w05 5, w01 4, w02 1, w03 1. The 2→4 rollout later was clean (no mismatch, no crash). This is the hot-restart UDP forwarding path we carry from hot restart: forward UDP packets by listener address and network namespace envoyproxy/envoy#47743 (merged upstream 2026-09-30) plus aether1050 — so the upstream code very likely has the same out-of-range index; reporting it there is the maintainer's call.
The supervisors then started Envoy from scratch (no live predecessor; starting fresh at epoch 0).
On w01 and w03 the from-scratch Envoy never added the listeners for pods created afterwards (the agent generated them; w02/w04/w05 added the same listeners within 1–4 s) → the k6 dial timeouts, 127.0.0.1:18081 connection refused for the new probers, health gateway unreachable from the agent, OTLP export timeouts — until each node's next handoff (w01 21:45:25, w03 21:46:18). That second failure is a supervisor bug, filed separately.
This issue now tracks (1) the crash. Fix options: bounds-check the forwarded worker index in the child and drop (or re-hash onto index % concurrency) instead of dereferencing — as a carried patch with a test in //bazel/patches:carried_patch_tests; and/or have the supervisor refuse a HOT restart across a concurrency change and do a drain-then-fresh-start instead. Until fixed, proxy.concurrency must not be changed downward on a live mesh.
Activity
[-]proxy: changing proxy.concurrency on a live mesh black-holed ~10% of new connections from freshly created pods on 2 of 5 nodes until the next same-count restart[/-][+]proxy: Envoy segfaults in HotRestartingChild::onForwardedUdpPacket when the successor has fewer workers than the parent (4→2 hot restart, 'Mismatched worker index')[/+]bpalermo commentedon Oct 1, 2026
Root cause corrected (analysis of the 2026-10-01 4→2 rollout from the logs)
My orphaned-reuse-port-socket hypothesis above was wrong. What happened:
HotRestartingChild::onForwardedUdpPacket, right afterMismatched worker index. expected 3, actual 1(andexpected 2, actual 0). The parent forwards QUIC/UDP datagrams tagged with ITS worker index (0–3); a child with 2 workers has no worker 2 or 3. Crash counts during the rollout: w05 5, w01 4, w02 1, w03 1. The 2→4 rollout later was clean (no mismatch, no crash). This is the hot-restart UDP forwarding path we carry from hot restart: forward UDP packets by listener address and network namespace envoyproxy/envoy#47743 (merged upstream 2026-09-30) plus aether1050 — so the upstream code very likely has the same out-of-range index; reporting it there is the maintainer's call.no live predecessor; starting fresh at epoch 0).127.0.0.1:18081 connection refusedfor the new probers,health gateway unreachablefrom the agent, OTLP export timeouts — until each node's next handoff (w01 21:45:25, w03 21:46:18). That second failure is a supervisor bug, filed separately.This issue now tracks (1) the crash. Fix options: bounds-check the forwarded worker index in the child and drop (or re-hash onto
index % concurrency) instead of dereferencing — as a carried patch with a test in//bazel/patches:carried_patch_tests; and/or have the supervisor refuse a HOT restart across a concurrency change and do a drain-then-fresh-start instead. Until fixed,proxy.concurrencymust not be changed downward on a live mesh.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
docs(runbook): sizing nodes for a proxy hot restart (#1093) (#1132)
fix(proxy): a hot-restart child maps a forwarded UDP worker index it …
fix(supervisor): send the self-drain only to this supervisor's own En…
fix(proxy): a hot-restart child with fewer workers than its parent no…