Skip to content

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
bpalermo merged 1 commit into
mainfrom
fix/1058-supervisor-wedge-hardening
Sep 29, 2026

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

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.

#1058 part 2: child-silent signal

#1058 part 3: restartCount 0. Documented, no code change needed

From the code, a watchdog exit is Run returning an error. proxy-supervisor/main.go turns that into os.Exit(1), the proxy container exits 1, and the kubelet restarts it in the same pod (DaemonSet pods are restartPolicy: Always). So restartCount goes up by one and lastState.terminated.exitCode is 1.

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. containerStatuses is sorted by name, and with the ext_authz sidecar enabled [0] is authz, not proxy. The runbook now gives a by-name jsonpath that reads the proxy container's restartCount / exitCode / finishedAt. The exit log line now carries exitCode=1, and the comment at the exit site spells this out.

#1059: docs

No charts/ changes.

Tests

wedge_test.go (fake clock, stub Envoy processes):

Run locally:

  • bazel test --config=race //agent/internal/proxy/hotrestart:all: PASS
  • bazel test //agent/cmd/proxy-supervisor/... //agent/internal/supervisorcmd/...: PASS (incl. deps_test)
  • scripts/check-proxy-supervisor-deps.sh: OK
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: clean
  • make format-check: clean

Closes #1058
Closes #1059

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…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
@bpalermo
bpalermo merged commit c82503f into main Sep 29, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/1058-supervisor-wedge-hardening branch September 29, 2026 20:00
@bpalermo

Copy link
Copy Markdown
Owner Author

Verified on talos: the proxy pod's containerStatuses are ordered authz,proxy, so my #1050 reading of .status.containerStatuses[0].restartCount was the ext_authz sidecar, not the proxy — the 'restartCount 0' mystery was my query. The runbook's by-name command is the right fix. Also confirmed the container-scoped LogsQL filter works: service.name:aether-proxy "k8s.container.name":proxy "liveness watchdog fired" returns the 2 lines from the #1050 roll (2026-09-28 16:38Z).

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment