Repository navigation
fix(proxy): pass --skip-hot-restart-parent-stats so the hot-restart child never blocks on the parent's main thread (#1050); hotrestart-wedge harness + soak gates - #1056
Merged
Conversation
…1050) The hot-restart child's periodic getParentStats is a blocking, timeout-less recvmsg on the parent's main thread, while the parent's main thread forwards unowned QUIC/UDP datagrams to the child with a blocking, timeout-less sendmsg. When the child's datagram queue fills during a stats request both main threads wait on each other forever. proxy.hotRestart.skipParentStats (default true) removes the only periodic child->parent blocking call. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…adlock e2e/hotrestart-wedge.sh drives h3 load through SIGHUP hot restarts on the eastwest-quic bring-up and flags a WEDGE when the new epoch's admin stays dark >= 5 s, then captures per-thread syscall/wchan/kernel stacks and (WEDGE_GDB_IMAGE) symbolized main-thread backtraces of every envoy. Unforced (17 h3 listeners, ~1900 inbound rps, 30 restarts): 0 wedges. WEDGE_FREEZE_S=6 (SIGSTOP the child inside the parent's forwarding window) wedges 3/3 with the production signature: parent main thread in runPostCallbacks -> RpcStream::sendHotRestartMessage (forwarded UDP, blocking sendmsg, sock_alloc_send_pskb), child main thread in flushStatsInternal -> HotRestartingChild::getParentStats (blocking recvmsg); both ignore SIGTERM; the 30 s supervisor watchdog kills both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…unbook The wedge harness applies proxy.hotRestart.skipParentStats at `up` (WEDGE_SKIP_PARENT_STATS, via HR_SKIP_PARENT_STATS in the eastwest-quic hot-restart bring-up) and reports what the live Envoy was started with, so the forced-fault run is a red-then-green check. The soak README grades the per-roll wedge signature; the runbook explains the deadlock, the flag and what it does not cover. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…aits out the crash-loop backoff The node-side `sh -c` that matched `*envoy*--restart-epoch*` carried the pattern in its own argv and matched itself, so the flag report said "yes" on a cluster without the flag. After a wedge the watchdog's container restart backs off longer each time; a fixed 60 s sleep found no supervisor and a failing admin curl aborted the run under pipefail. Record the 2026-09-28 red (4/4) and green (0/6) results. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Sep 28, 2026
bpalermo
added a commit
that referenced
this pull request
Sep 28, 2026
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
added a commit
that referenced
this pull request
Sep 28, 2026
…od's app containers until its SVID exists — the egress twin of the inbound readiness gate (#1053) (#1055) * feat(identity): injected identity-ready init container holds a mesh pod's app containers until its SVID exists — the egress twin of the inbound readiness gate (#1053) A pod that sent within ~8 s of its CNI ADD had no SVID yet: the source proxy had no client certificate for it and connects sat until connect_timeout (503 UF on h2). The CNI ADD is deliberately not blocked (SPIRE must not become a hard dependency of sandbox creation); the app container is gated instead. - agent/cmd/identity-ready: waits on the pod's own SPIRE Workload API (csi.spiffe.io, mounted into the init container only) until an X.509 SVID is issued, then exits 0. Fail closed by default, periodic WARN naming the socket and last error, optional --timeout. Links gRPC + go-spiffe's generated Workload API client only; deps_test holds an explicit module allow-list. Ships as an extra layer in the agent image. - controller/internal/podmutate: injects aether-identity-ready FIRST (ahead of the pod's own init containers) plus its CSI volume into every mesh pod; skips aether.io/identity-gate=false, hostNetwork and mesh-ignored namespaces; idempotent; Pod Security "restricted"-compliant. - chart: controller.webhook.identityGate.{enabled,image,pullPolicy,timeout, resources}, default ON, never rendered with spire.enabled=false; chart 1.0.4. - e2e/eastwest-quic.sh E6: fresh ServiceAccount, request at container start. kind: gate off -> first request stalls 3.4-5.4 s for the cert; gate on -> gate holds 3.6-4.1 s, first request 200 in 12-14 ms as the new SA. - docs: workload requirements, configuration, runbook, proposal 036 follow-up. Closes #1053 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * test(identity): neutral image registry in gate fixtures (check-registry-config) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * chore(chart): aether 1.0.5 — main took 1.0.4 in #1056 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Root cause
Full analysis: #1050 (comment)
On rev248 one proxy roll in ~60 wedged both Envoy epochs until the supervisor's liveness watchdog killed them. The two main threads deadlock over the hot-restart domain sockets:
DrainListenersRPC, every QUIC/UDP datagram the parent's workers read that no parent session owns is posted to the parent's main thread and sent to the child with a blocking, timeout-lesssendmsg(hot_restarting_parent.cc:60-85,hot_restarting_base.cc:84-143). The child's UDP listeners stay paused until the parent exits, so for the whole--parent-shutdown-time-swindow every packet of every new QUIC connection takes this path.getParentStats, a blocking, timeout-lessrecvmsg(hot_restarting_child.cc:161-176).recvmsg, the parent is parked insendmsgand never reads the stats request. Admin, xDS and timers stop on both processes, and SIGTERM (a main-dispatcher event) cannot land on either.The fix:
--skip-hot-restart-parent-stats, on by defaultproxy.hotRestart.skipParentStats(default true) renders--envoy-arg=--skip-hot-restart-parent-statsthrough the supervisor's existing extra-args path (buildEnvoyCmd, which also feedsenvoy --mode validate). The child then never makes the blocking stats call, so its half of the deadlock is gone.726d7ac(source/server/options_impl.cc:85, a TCLAPSwitchArg, read instripped_main_base.cc:125/142).agent/internal/xds/proxyand//test/envoy_validatedon't need to know about it: it is a command-line option, not bootstrap.//agent/internal/supervisorcmd:TestFlagsCoverTheChartContractstill passes (the supervisor-side flag is--envoy-arg).increase()/rate()dashboards don't change.1.0.3→1.0.4.aether_proxy_skip_parent_stats_testchecks the arg renders by default.aether_proxy_skip_parent_stats_off_testrenders with the knobfalseand checks that the--service-zonevalue line is followed directly byenv:. rules_helm can only assert that a pattern is present, so absence is pinned by position.Harness:
e2e/hotrestart-wedge.sh(fromspike/1050-hotrestart-wedge-repro, tidied)This is the kind leg that reproduced the wedge with symbolized stacks. Changes from the spike:
WEDGE_SKIP_PARENT_STATS(applied atupthrough the newHR_SKIP_PARENT_STATSineastwest-quic-hotrestart.sh).runnow reportsSKIP_PARENT_STATS=read from the live Envoy argv.sh -ccarried the*envoy*pattern in its own argv. The first red run therefore reportedyeson a cluster without the flag.runwaits for the proxy to come back instead of sleeping a fixed 60 s. Each recovery is a container restart, so kubelet's crash-loop backoff grows with every wedge, and a fixed sleep aborted the run.Both arms ran on kind: eastwest-quic bring-up, 17 h3 inbound listeners, 24 loops × 20 rps per (source, h3 destination), SIGHUP hot restarts,
WEDGE_FREEZE_S=6.Red: knob
false. Every restart wedged. Kernel stacks: parent main thread inunix_dgram_sendmsg, child main thread in__unix_dgram_recvmsg, the same as in production.Two earlier red runs (before the recovery fix) also wedged, but the first restart after a fresh epoch 0 came through 2 of 3 times. Forcing the fault makes a wedge very likely, not certain.
Green: knob
true(the chart default). Same cluster,upagain (a helm upgrade that rolls the proxy), same fault:Soak gates (
e2e/soak/README.md, "The hot-restart wedge gates (#1050)")Each gate is graded per roll.
liveness watchdog firedand zerodrain deadline elapsed, killing envoy epochfor an epoch with a live child, as LogsQL overservice.name="aether-proxy". The zero only counts ifstarting workersreturns one line per node per roll over the same window; otherwise it is vacuous.503 UCwithQUIC_TOO_MANY_RTOS|Network_blackhole_detectedtoward the rolling node stays at baseline (0 on non-wedged rev248 rolls vs ~550 on the wedged one).QUIC_PUBLIC_RESETat a roll is the separate, milder case.starting workersis the wedge signature, whether or not the watchdog later fires.Runbook
New
docs/runbook.mdsection, "A roll wedges both epochs afterstarting workers(#1050)", covering:duplicateParentListenSocketon an LDS add inside the window is the same blocking, timeout-less call, and the parent's main thread can still stall without deadlockingEAGAIN, and receive timeouts on the child. Nothing was posted upstream.Not in this PR
starting workers". The supervisor does not read Envoy's log stream, so this is not a few-line change. Gate (c) grades it from logs for now; follow-up.restartCount 0seen on talos after the watchdog fired. On kind the watchdog exit did restart the container.Closes #1050. The observed deadlock is removed, and the red/green run above shows it. The remaining
duplicateParentListenSockettrigger and the upstream Envoy fix are separate findings and belong in their own issue, not in this one.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr