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
supervisor: on rev242 the old proxy pod gets SIGTERM mid-handoff (6–11 s after the fork, before the successor's readiness gate) in 7 of 15 handoffs #991
Found while answering #846 item 3 on the 2026-09-27 soak (rev242 / chart 0.95.3, proxy pin with envoy#47743+#47740).
On rev242, 7 of the first 15 hot-restart handoffs (rolls at 10:55, 11:31, 13:31Z) show the OLD pod's supervisor logging termination requested mid-handoff 6–11 s after the fork — before the new pod's readiness gate (+18.0 s). aether_supervisor_shutdown_branch_total{branch="handoff"} = 1 on all 5 nodes in the window. On rev239 (2026-09-26 soak) this happened once in 30 handoffs (w04 at 16:52:44Z). Every handoff still completed with the child terminating the parent (the handoff branch waits for it), and the prober saw no errors — so this is a timing change, not a data-plane failure yet. But the design intent (#795) is that the DaemonSet deletes the old pod only after the successor is Ready; a SIGTERM before that means the surge pod was considered Ready earlier, or the DaemonSet's update strategy changed behaviour. Also from the same reading: rev242 reaches starting workers 1–2 s later than rev239 (fork → LIVE p50 4.27 s vs 3.08 s).
To do: compare the two builds' readiness gating (proxy-ready marker timing vs pod ready: envoy live at newest epoch), check whether the chart's DaemonSet maxSurge/readiness settings changed between 0.94.0 and 0.95.3, and decide whether the early SIGTERM is acceptable given the handoff branch tolerates it. Queries and log strings are in #846's item-3 comment.
Nothing changed in the chart or the supervisor between rev239 (d526bf2) and rev242 (cb79180). git log d526bf2..cb79180 -- agent/internal/proxy agent/cmd is empty, agent-proxy-daemonset.yaml is identical, and the values.yaml diff only touches agent.eastWestQuicServices, cniInstall.otlp* and the proxy image pin. The live DS matches the chart: maxSurge: 1, maxUnavailable: 0, no minReadySeconds, exec probe period 2s / failureThreshold 3 / timeout 1s, grace 180s.
What changed is how long the successor Envoy's main thread takes to get from fork to starting workers. Under soak load that went from 2.2–3.5 s on rev239 to 3.2–6.0 s on rev242 (one 31 s outlier). Two supervisor assumptions break when that happens. They produce two separate populations of mid-handoff SIGTERMs.
A. SIGTERM at about +19 s, after the successor is Ready but before the parent is gone (13 of 30 on rev242)
The ready gate is anchored on the fork. Envoy's parent-shutdown timer is anchored on startWorkers.
successorReadyGate() (agent/internal/proxy/hotrestart/supervisor.go) returns fork + ParentShutdownTime + readyGateBuffer = fork + 15 s + 3 s = fork + 18.0 s. That matches the "pod ready" line at +18.00–18.10 s on every roll.
Envoy arms startParentShutdownSequence() inside startWorkers(). Measured shutting down parent after drain − starting workers is 14.93–15.00 s on every roll of both builds.
So the predecessor dies at workers + 15 s. The 3 s buffer only covers a fork→workers time of under 3 s. rev239 had 2.2–3.5 s, so the parent usually died at 17.1–18.4 s, before the gate. rev242 has 3.2–6.0 s, so the parent dies at 18.2–21.0 s, after the gate.
When the successor goes Ready at +18.0 s while the old Envoy is still the serving parent, the DaemonSet deletes the old pod about 1 s later. The old supervisor's handleShutdown probe sees admin answering at the new epoch, so it takes the !live branch (termination requested mid-handoff). Then successor took over fires, which gives shutdown_branch_total{branch="handoff"} = 1 per node per roll.
On rev239 this state was rare because the parent was normally already dead at +18 s. The old supervisor then exited on its own and logged no termination requested at all (29 of 30 rows below).
B. Early SIGTERM at +6–11 s, before the successor's gate (9 of 30 on rev242, 1 of 30 on rev239)
The old supervisor drops its parent readiness hold on a single unreachable admin probe.
reachable is false whenever /server_info does not answer within readyPollInterval (1 s). After shutting down admin due to child startup, the port 9901 answering is the child's admin. Its main thread is busy applying the first LDS/SDS batch between starting main dispatch loop and starting workers, which on rev242 includes 13 per-pod inbound_*_h3 QUIC listeners on w05 (feat(038): per-pod HTTP/3 inbound on UDP:18008 — unconditional, same identity as the TCP inbound (Phase 4a) #953, unconditional since 0.95.x) plus the udp_proxy matchers. One probe times out, and the old pod clears its marker.
Example, w05 at 10:55:31Z. The old pod 7d2g5 logs holding readiness at +1.90 s, then pod not ready: envoy not live at newest epoch at +3.77 s. Its Envoy is alive (it keeps logging until +19.5 s), so anyChildTracked() was true and the hold can only have dropped on reachable=false. Then 3 probe failures × 2 s pass, the pod becomes NotReady, and the DaemonSet's manage loop deletes it: an old pod that is not Ready is replaced immediately once a surge pod exists. SIGTERM arrives at +9.71 s. The authz sidecar in the same pod logs Shutting down... 0.1 s earlier.
Every early SIGTERM in both builds is preceded by the old pod's pod not ready 5.0–6.3 s earlier. That gap is the probe's failureThreshold × period plus DS sync. The window only opens when the child's pre-workers phase is long enough for a 1 s probe to hit it, so the slower child init on rev242 makes it common.
Timelines
Offsets are seconds from the successor's starting cross-pod hot restart (fork).
event
source
hold
old pod holding readiness
workers
new Envoy starting workers
old NR
old pod pod not ready (marker removed)
SIGTERM
old pod termination requested mid-handoff
new Ready
new pod pod ready: envoy live at newest epoch (marker written; kubelet flips within one 2 s probe period)
psd
new Envoy shutting down parent after drain
took
old pod successor took over during shutdown wait
rev239 (0.94.0, d526bf2), soak window 2026-09-26
fork (UTC)
node
hold
workers
old NR
SIGTERM
new Ready
psd
took
14:16:13
w03
3.23
2.33
18.23
—
18.01
17.26
—
14:52:12
w04
4.24
2.95
19.23
—
18.01
17.89
—
16:52:36
w04
—
3.46
3.18
8.85
18.00
18.41
18.99
18:16:12
w02
2.13
3.06
19.09
—
18.01
18.01
—
Over 30 handoffs on rev239: workers 2.17–3.46, psd 17.13–18.41, early SIGTERM 1 of 30 (the w04 row above, the only roll where the old pod's hold dropped), and no other termination requested.
rev242 (0.95.3, cb79180), soak 2026-09-27
fork (UTC)
node
hold
workers
old NR
SIGTERM
new Ready
psd
took
10:55:31
w05
1.90
3.98
3.77
9.71
18.04
18.97
19.47
10:55:45
w04
4.88
3.98
—
19.06
18.00
18.97
19.54
13:32:04
w02
—
3.79
0.61
6.01
18.01
18.78
19.34
14:56:17
w01
5.16
31.27
31.14
32.24
31.59
46.31
46.86
15:31:29
w03
3.16
2.97
18.96
—
18.00
17.96
—
Over 30 handoffs on rev242: workers 2.97–6.0 (plus the 31.27 outlier), psd 17.96–21.0 (46.3 on the outlier).
22 of 30 mid-handoff SIGTERMs. 9 are early (+6.0–11.3 s: 10:55 w05/w01, 11:31 w05, 13:31 w01, 13:32 w02/w04, 14:08 w05/w04, 15:33 w01) and 13 are at +18.9–19.8 s (population A).
The 8 without a SIGTERM all had psd ≤ 18.8, so the old pod exited on its own before the DaemonSet reached it.
The w01 14:56 outlier: the successor was not LIVE until +31 s, and the old parent then lived another 15 s past the successor's Ready.
The rev241 night rolls (2026-09-26 23:37–23:52Z, same QUIC listeners and Envoy patches, no soak load) had workers 2.2–3.6 s with one 7.7 s outlier, and exactly one early SIGTERM in 15 (that same 7.7 s roll). So what regressed is successor init time under load. Nothing in the logs points to a different hot-restart protocol in the patched Envoy. I have not isolated how much of the extra init time comes from the per-pod h3 listeners versus the #47743/#47740 patches. Pod-condition history and kubectl get events for these rolls are no longer retained; the marker times above are the supervisor's own logs.
Is it harmless?
For the data plane, so far yes. In all 22 cases the old supervisor took the handoff arm. It never signals Envoy and waits (budget 155 s, inside the 180 s grace) for the successor's parent-shutdown. Every case logged successor took over 0.4–0.9 s after the successor's shutting down parent after drain. The prober and k6 were clean on rev242.
It is still a regression against the #132/#795 invariant ("the old pod stays until the successor has taken over"), for two reasons:
Once the old pod has a deletionTimestamp it cannot go back to serving. If the successor then wedges pre-LIVE, which is exactly what the handoff watchdog exists for, the node is left relying on the 155 s drain_fallback instead of an old pod that is still Ready. Before, the DaemonSet would have kept it.
In population B the pod's authz sidecar is SIGTERMed about 9 s early. That is harmless today (ext_authz is inert on talos, and the successor's OPA already owns the socket path), but it is the same premature-teardown shape.
Recommended fix (two parts, both in agent/internal/proxy/hotrestart)
Anchor the successor ready gate on the child's first observed LIVE, not the fork (fixes A). In onLiveEpoch, on the first LIVE confirmation of a cross-pod successor epoch, set readyGate = max(readyGate, now + ParentShutdownTime + buffer).
This is sound because Envoy's init-complete path (startWorkers() → the workers-started completion) is what both flips admin to LIVE and arms startParentShutdownSequence(). Only worker-thread startup separates the two (psd − starting workers measured 14.93–15.00 s against PST 15 s). So the parent is gone by about LIVE_observed + PST + exit (0.4–0.9 s measured).
A 1–2 s buffer is enough.
Cost: Ready moves from fork+18 to about fork+19.5–23 under load, roughly 1.5–5 s per node per roll.
Update TestInitStartEpochPublishesEpochAndGateTogether and add a gate test where LIVE arrives after 5 s.
Don't drop the parent hold on a single unreachable tick (fixes B).hold := ready && s.anyChildTracked() && (reachable || time.Since(unreachableSince) < s.adminUnresponsiveDeadline()), passing unreachableSince into onNotLiveEpoch.
The admin watchdog already ends a genuinely wedged admin at exactly that bound: everLive && !reachable && childTracked for 30 s, then exit and container restart. So the hold stays bounded, as fix(supervisor): hold readiness while serving as hot-restart parent #132 intended. It just stops treating a busy successor's 1 s timeout as "gone".
Add a test next to the existing onNotLiveEpoch cases in epoch_test.go asserting that reachable=false with a recent unreachableSince still holds.
With both fixes, termination requested mid-handoff should return to about 0 per roll: the old pod exits on its own at psd before the successor goes Ready. shutdown_branch_total{branch="handoff"} would then again be the rare signal it was on rev239.
No PR opened: fix 1 changes the roll's per-node duration and fix 2 relaxes a #132 safety condition, so both are design choices rather than mechanical fixes.
First roll with #1026 on the successor side (talos rev243, 2026-09-27 22:50–22:53Z, rev242 → 1.0.1-88312db): successor ready gate anchored anchor=live sinceFork=3.0–6.0 s readyGateAfterFork=20.0–23.0 s on all five nodes, and group A (SIGTERM at ≈ +19 s) went 13/30 → 0/5. Group B was still 2/5 (w04 at +7 s, w01 at +10 s, pod not ready: envoy not live at newest epoch 1.5 s after the hold): expected, because the pods that got deleted were still running the rev242 supervisor, and fix 2 lives on the parent side. The next proxy roll (new → new) is the test for fix 2; gate: increase(aether_supervisor_shutdown_branch_total{aether_supervisor_shutdown_branch="handoff"}[roll]) = 0 on every node. Data plane was clean either way (prober 0 errors, UDP dialer +0 per node).
Second roll, new → new (talos rev244, 2026-09-28 00:40–00:43Z, both sides on #1026): 0 of 5 handoffs had a mid-handoff termination. Fix 2 fired exactly where group B used to start: w04 at 00:40:55 and w02 at 00:42:03 logged holding readiness through unreachable admin: successor likely initializing (holdBound=30s), and every pod not ready: envoy not live at newest epoch came only at +14–15 s, the normal end of the hold. Fix 1 anchored the successor's gate to LIVE on all five nodes (sinceFork 3.3–5.0 s, gate 20.3–22.0 s after the fork). Data plane clean (prober 0 errors, UDP dialer +0). One grading note: aether_supervisor_shutdown_branch_total carries no pod label, so the old and new pod share one series per node and a branch taken less than a scrape before exit can be missed — the supervisor log lines are the authoritative gate.
Activity
bpalermo commentedon Sep 27, 2026
Root cause
Nothing changed in the chart or the supervisor between rev239 (
d526bf2) and rev242 (cb79180).git log d526bf2..cb79180 -- agent/internal/proxy agent/cmdis empty,agent-proxy-daemonset.yamlis identical, and thevalues.yamldiff only touchesagent.eastWestQuicServices,cniInstall.otlp*and the proxy image pin. The live DS matches the chart:maxSurge: 1,maxUnavailable: 0, nominReadySeconds, exec probeperiod 2s / failureThreshold 3 / timeout 1s, grace 180s.What changed is how long the successor Envoy's main thread takes to get from fork to
starting workers. Under soak load that went from 2.2–3.5 s on rev239 to 3.2–6.0 s on rev242 (one 31 s outlier). Two supervisor assumptions break when that happens. They produce two separate populations of mid-handoff SIGTERMs.A. SIGTERM at about +19 s, after the successor is Ready but before the parent is gone (13 of 30 on rev242)
The ready gate is anchored on the fork. Envoy's parent-shutdown timer is anchored on
startWorkers.successorReadyGate()(agent/internal/proxy/hotrestart/supervisor.go) returnsfork + ParentShutdownTime + readyGateBuffer= fork + 15 s + 3 s = fork + 18.0 s. That matches the "pod ready" line at +18.00–18.10 s on every roll.startParentShutdownSequence()insidestartWorkers(). Measuredshutting down parent after drain − starting workersis 14.93–15.00 s on every roll of both builds.workers + 15 s. The 3 s buffer only covers a fork→workers time of under 3 s. rev239 had 2.2–3.5 s, so the parent usually died at 17.1–18.4 s, before the gate. rev242 has 3.2–6.0 s, so the parent dies at 18.2–21.0 s, after the gate.handleShutdownprobe sees admin answering at the new epoch, so it takes the!livebranch (termination requested mid-handoff). Thensuccessor took overfires, which givesshutdown_branch_total{branch="handoff"}= 1 per node per roll.On rev239 this state was rare because the parent was normally already dead at +18 s. The old supervisor then exited on its own and logged no
termination requestedat all (29 of 30 rows below).B. Early SIGTERM at +6–11 s, before the successor's gate (9 of 30 on rev242, 1 of 30 on rev239)
The old supervisor drops its parent readiness hold on a single unreachable admin probe.
onNotLiveEpoch(coordination.go) holds withhold := ready && reachable && s.anyChildTracked(). That condition has been unchanged since fix(supervisor): hold readiness while serving as hot-restart parent #132 (ea13dce,git log -S "ready && reachable").reachableis false whenever/server_infodoes not answer withinreadyPollInterval(1 s). Aftershutting down admin due to child startup, the port 9901 answering is the child's admin. Its main thread is busy applying the first LDS/SDS batch betweenstarting main dispatch loopandstarting workers, which on rev242 includes 13 per-podinbound_*_h3QUIC listeners on w05 (feat(038): per-pod HTTP/3 inbound on UDP:18008 — unconditional, same identity as the TCP inbound (Phase 4a) #953, unconditional since 0.95.x) plus the udp_proxy matchers. One probe times out, and the old pod clears its marker.7d2g5logsholding readinessat +1.90 s, thenpod not ready: envoy not live at newest epochat +3.77 s. Its Envoy is alive (it keeps logging until +19.5 s), soanyChildTracked()was true and the hold can only have dropped onreachable=false. Then 3 probe failures × 2 s pass, the pod becomes NotReady, and the DaemonSet's manage loop deletes it: an old pod that is not Ready is replaced immediately once a surge pod exists. SIGTERM arrives at +9.71 s. Theauthzsidecar in the same pod logsShutting down...0.1 s earlier.pod not ready5.0–6.3 s earlier. That gap is the probe's failureThreshold × period plus DS sync. The window only opens when the child's pre-workers phase is long enough for a 1 s probe to hit it, so the slower child init on rev242 makes it common.Timelines
Offsets are seconds from the successor's
starting cross-pod hot restart(fork).holding readinessstarting workerspod not ready(marker removed)termination requested mid-handoffpod ready: envoy live at newest epoch(marker written; kubelet flips within one 2 s probe period)shutting down parent after drainsuccessor took over during shutdown waitrev239 (0.94.0,
d526bf2), soak window 2026-09-26Over 30 handoffs on rev239: workers 2.17–3.46, psd 17.13–18.41, early SIGTERM 1 of 30 (the w04 row above, the only roll where the old pod's hold dropped), and no other
termination requested.rev242 (0.95.3,
cb79180), soak 2026-09-27Over 30 handoffs on rev242: workers 2.97–6.0 (plus the 31.27 outlier), psd 17.96–21.0 (46.3 on the outlier).
The rev241 night rolls (2026-09-26 23:37–23:52Z, same QUIC listeners and Envoy patches, no soak load) had workers 2.2–3.6 s with one 7.7 s outlier, and exactly one early SIGTERM in 15 (that same 7.7 s roll). So what regressed is successor init time under load. Nothing in the logs points to a different hot-restart protocol in the patched Envoy. I have not isolated how much of the extra init time comes from the per-pod h3 listeners versus the #47743/#47740 patches. Pod-condition history and
kubectl get eventsfor these rolls are no longer retained; the marker times above are the supervisor's own logs.Is it harmless?
For the data plane, so far yes. In all 22 cases the old supervisor took the
handoffarm. It never signals Envoy and waits (budget 155 s, inside the 180 s grace) for the successor's parent-shutdown. Every case loggedsuccessor took over0.4–0.9 s after the successor'sshutting down parent after drain. The prober and k6 were clean on rev242.It is still a regression against the #132/#795 invariant ("the old pod stays until the successor has taken over"), for two reasons:
drain_fallbackinstead of an old pod that is still Ready. Before, the DaemonSet would have kept it.authzsidecar is SIGTERMed about 9 s early. That is harmless today (ext_authz is inert on talos, and the successor's OPA already owns the socket path), but it is the same premature-teardown shape.Recommended fix (two parts, both in
agent/internal/proxy/hotrestart)onLiveEpoch, on the first LIVE confirmation of a cross-pod successor epoch, setreadyGate = max(readyGate, now + ParentShutdownTime + buffer).startWorkers()→ the workers-started completion) is what both flips admin to LIVE and armsstartParentShutdownSequence(). Only worker-thread startup separates the two (psd − starting workersmeasured 14.93–15.00 s against PST 15 s). So the parent is gone by aboutLIVE_observed + PST + exit (0.4–0.9 s measured).TestInitStartEpochPublishesEpochAndGateTogetherand add a gate test where LIVE arrives after 5 s.hold := ready && s.anyChildTracked() && (reachable || time.Since(unreachableSince) < s.adminUnresponsiveDeadline()), passingunreachableSinceintoonNotLiveEpoch.everLive && !reachable && childTrackedfor 30 s, then exit and container restart. So the hold stays bounded, as fix(supervisor): hold readiness while serving as hot-restart parent #132 intended. It just stops treating a busy successor's 1 s timeout as "gone".onNotLiveEpochcases inepoch_test.goasserting thatreachable=falsewith a recentunreachableSincestill holds.With both fixes,
termination requested mid-handoffshould return to about 0 per roll: the old pod exits on its own at psd before the successor goes Ready.shutdown_branch_total{branch="handoff"}would then again be the rare signal it was on rev239.No PR opened: fix 1 changes the roll's per-node duration and fix 2 relaxes a #132 safety condition, so both are design choices rather than mechanical fixes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
fix(supervisor): anchor the successor's ready gate to its first LIVE …
bpalermo commentedon Sep 27, 2026
First roll with #1026 on the successor side (talos rev243, 2026-09-27 22:50–22:53Z, rev242 → 1.0.1-88312db):
successor ready gate anchored anchor=live sinceFork=3.0–6.0 s readyGateAfterFork=20.0–23.0 son all five nodes, and group A (SIGTERM at ≈ +19 s) went 13/30 → 0/5. Group B was still 2/5 (w04 at +7 s, w01 at +10 s,pod not ready: envoy not live at newest epoch1.5 s after the hold): expected, because the pods that got deleted were still running the rev242 supervisor, and fix 2 lives on the parent side. The next proxy roll (new → new) is the test for fix 2; gate:increase(aether_supervisor_shutdown_branch_total{aether_supervisor_shutdown_branch="handoff"}[roll])= 0 on every node. Data plane was clean either way (prober 0 errors, UDP dialer +0 per node).bpalermo commentedon Sep 28, 2026
Second roll, new → new (talos rev244, 2026-09-28 00:40–00:43Z, both sides on #1026): 0 of 5 handoffs had a mid-handoff termination. Fix 2 fired exactly where group B used to start: w04 at 00:40:55 and w02 at 00:42:03 logged
holding readiness through unreachable admin: successor likely initializing (holdBound=30s), and everypod not ready: envoy not live at newest epochcame only at +14–15 s, the normal end of the hold. Fix 1 anchored the successor's gate to LIVE on all five nodes (sinceFork 3.3–5.0 s, gate 20.3–22.0 s after the fork). Data plane clean (prober 0 errors, UDP dialer +0). One grading note:aether_supervisor_shutdown_branch_totalcarries no pod label, so the old and new pod share one series per node and a branch taken less than a scrape before exit can be missed — the supervisor log lines are the authoritative gate.fix(supervisor): kill both epochs at once when both are wedged, expor…