Repository navigation
fix(supervisor): kill both epochs at once when both are wedged, export a child-silent signal (#1058); runbook: supervisor logs are in VictoriaLogs (#1059) - #1072
Merged
Conversation
…t a child-silent signal (#1058); runbook: supervisor logs are in VictoriaLogs (#1059) #1058, from the #1050 deadlock (both Envoy main threads parked in blocking hot-restart socket calls, where SIGTERM cannot land): - When the liveness watchdog fires and every epoch of the node's hot-restart pair has been silent on the admin for the watchdog's bound, SIGKILL at once instead of SIGTERM + DrainTime + shutdownGrace (15 s of extra node outage in #1050). Admin answers are now attributed per restart epoch; the pair is the tracked epochs, the cross-pod predecessor until this pod is Ready, and a newer epoch the admin last answered as. One silent epoch, or a single epoch with no handoff, keeps SIGTERM then grace. - A hot-restart child (epoch > 0) whose admin stops answering for 10 s after its first observed LIVE (the #991 anchor; `starting workers`) is logged once per epoch as `hot-restart child silent` and counted in aether_supervisor_child_silent_total (seeded at zero). - The watchdog exit path is documented: os.Exit(1), in-place container restart (restartCount +1), no re-exec; only an already-terminating pod is not restarted. #1059: the runbook no longer claims the supervisor's logs never reach VictoriaLogs; they are the proxy container's stream (service.name aether-proxy, k8s.container.name proxy). Fix `-c aether-proxy` to `-c proxy`, add a LogsQL example, the child-silent signal and the immediate-kill lines, and scope the #1050 soak gates to the container stream with a 0-per-roll child-silent gate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Owner
Author
|
Verified on talos: the proxy pod's |
bpalermo
added a commit
that referenced
this pull request
Sep 29, 2026
… ledger, #1072) odcds.go: main's stream-scoped observeQUICTwin(streamID, name) with #979's dependency-set wording. The new server/quic_generation_test.go fixture puts demo/echo in the dependency set (RestoreDependency) instead of allow-listing it; the soak new-SA step's wording notes both destinations are QUIC-eligible since #979. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardens the proxy supervisor against the #1050 deadlock shape, and fixes the runbook's claim that the supervisor's logs never reach VictoriaLogs.
#1058 part 1: SIGKILL at once when both epochs are silent
In #1050 both Envoy main threads were parked in blocking hot-restart socket calls. Envoy handles signals on the main dispatcher, so neither process could act on the watchdog's SIGTERM, and the supervisor waited
DrainTime + shutdownGrace(15 s) before its SIGKILL. That was 15 s more node outage on top of the 30 s watchdog, and a fresh epoch 0 cannot bind until both processes are gone.noteAdminAnswer). A decoded/server_infonames itsrestart_epoch, and/readyonly runs on a connection verified for our epoch.handoffSilencebuilds the node's hot-restart pair from what the shared admin port can tell this supervisor:adminUnresponsiveDeadline. The newest epoch, if it never answered, counts from its fork.stopWedgedSIGKILLs right away when the pair has at least two epochs and all of them are silent. It logsboth hot-restart epochs silent; SIGKILLing now …withepochs=53,54 silentFor="53=41.8s 54=31.0s".#1058 part 2: child-silent signal
hot-restart child silent(epoch,silentSeconds,sinceLiveSeconds). It is also counted inaether_supervisor_child_silent_total(OTelaether.supervisor.child_silent, seeded at zero like the shutdown branches).startWorkers(), the step that logsstarting workers, so this is soak gate (c) turned into a metric. A fork anchor would count the xDS-gated init: it is unbounded, takes 2.2–6 s under load, and the successor's admin legitimately misses probes during it (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). Silence before LIVE stays the handoff watchdog's job.ParentShutdownTime+liveGateBuffer(by then the parent is gone). An admin that answers at any epoch is not silent.//agent/cmd/proxy-supervisor:deps_testandscripts/check-proxy-supervisor-deps.shboth pass.#1058 part 3:
restartCount 0. Documented, no code change neededFrom the code, a watchdog exit is
Runreturning an error.proxy-supervisor/main.goturns that intoos.Exit(1), theproxycontainer exits 1, and the kubelet restarts it in the same pod (DaemonSet pods arerestartPolicy: Always). SorestartCountgoes up by one andlastState.terminated.exitCodeis 1.restartCount 1, which matches.deletionTimestamp. That was not the case here.So 0 is not expected for the pod whose supervisor fired, and the code needed no fix. The likeliest cause of the talos reading is that the wrong container was read.
containerStatusesis sorted by name, and with the ext_authz sidecar enabled[0]isauthz, notproxy. The runbook now gives a by-name jsonpath that reads theproxycontainer'srestartCount/exitCode/finishedAt. The exit log line now carriesexitCode=1, and the comment at the exit site spells this out.#1059: docs
docs/runbook.md: dropped the false "never reach VictoriaLogs" sentence. The supervisor is PID 1 of theproxycontainer (Codebase review 2026-09-15: phased fix plan (correctness, races, binary size, tests, dead code, docs) #772), so its stdout is the streamservice.nameaether-proxy,k8s.container.nameproxy. Added a LogsQL example (… AND "k8s.container.name":proxy AND "liveness watchdog fired") and fixedkubectl logs -c aether-proxyto-c proxy; no container is namedaether-proxy.e2e/soak/README.md: the proxy hot restart: successor wedged after 'starting workers' (no log lines, admin unresponsive) — 30 s watchdog killed both epochs, ~55 s node-local outage on main-worker-02 (rev248 phase C roll 5, 16:37:52–16:38:50Z) #1050 gates (a) and (c) are scoped to the container stream. Gate (a) also matches the newboth hot-restart epochs silentline, since a both-silent watchdog no longer logsdrain deadline elapsed. Gate (c) now has a metric and log form, 0 per roll. The QUIC: 1–2 requests per proxy roll fail with a stateless reset from the successor (upstream_reset {QUIC_PUBLIC_RESET|FROM_PEER|Received_stateless_reset}) when the parent exits with h3 connections still carrying traffic #1054 gate queries access logs bylog_name, so they were already on the right stream.No
charts/changes.Tests
wedge_test.go(fake clock, stub Envoy processes):TestWatchdogKillsAtOnceWhenBothEpochsSilent: an in-pod pair whose stub ignores SIGTERM. Both epochs end killed and reaped in under 3 s (it was DrainTime + 5 s = 15 s), and no SIGTERM is sent.TestWatchdogKeepsSigtermGraceWhenOneEpochAnswers: the handoff-watchdog shape, where the parent answered 1 s ago. Only one epoch is silent, and both epochs receive SIGTERM (normal grace path).TestHandoffSilenceNeedsAPair: a single long-dark epoch is not "both silent".TestHandoffSilenceCrossPodSuccessor/TestHandoffSilenceCrossPodParent: both pods of proxy hot restart: successor wedged after 'starting workers' (no log lines, admin unresponsive) — 30 s watchdog killed both epochs, ~55 s node-local outage on main-worker-02 (rev248 phase C roll 5, 16:37:52–16:38:50Z) #1050 see the pair 3,4 / 1,2 as all silent. After Ready the predecessor leaves the pair, and the verdict reachesRunthroughwatchdogFired.TestChildSilentCountsOncePerEpoch: the proxy hot restart: successor wedged after 'starting workers' (no log lines, admin unresponsive) — 30 s watchdog killed both epochs, ~55 s node-local outage on main-worker-02 (rev248 phase C roll 5, 16:37:52–16:38:50Z) #1050 timeline. The count stays 0 at 9 s and is 1 at 10 s, with exactly one log line. It stays 1 through further ticks and a second streak, and the next epoch counts on its own.TestChildSilentNoFalsePositives: none of these count: a slow child dark 20 s before LIVE, a busy child dark 9.9 s after LIVE that then answers, a streak that starts after the window, an admin answering at another epoch, and a fresh epoch 0.Run locally:
bazel test --config=race //agent/internal/proxy/hotrestart:all: PASSbazel test //agent/cmd/proxy-supervisor/... //agent/internal/supervisorcmd/...: PASS (incl.deps_test)scripts/check-proxy-supervisor-deps.sh: OKbazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: cleanmake format-check: cleanCloses #1058
Closes #1059
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr