Repository navigation
Description
Umbrella for the fixes coming out of the 2026-09-15 five-way review of main @ 3c8f9c7 (stale docs, dead code, dependency tree, test consolidation, races/locks). Each phase is one or more independently mergeable PRs; order within a phase is the recommended order. Standing rules apply: any charts/ change bumps Chart.yaml; anything touching the data path or the supervisor gets a hitless-rollout validation on talos-main before it is called done; --config=race results and file:line evidence are in the review reports (kept locally with the session; ask for them).
Phase A — correctness (do first; each PR is small)
- A1 build/CI/chart hazards (no Go): chart: proxy.authzSidecar.failureMode is compared with a raw string equality, so any spelling variance silently selects fail-closed #770 (
failureModenormalisation + schema/enum + template test);tools/buildid/BUILD.bazel:36-45add//prober/cmd/proberto the build-id collision guard; deleteMakefile:113-120 publish(references//charts/agent,//charts/registrar— neither exists — afterpush-allhas already pushed images) andpush-proxy-image; drop the ignored--set spire.trustDomain=frome2e/multicluster_{replicator,waypoint}.sh; fix the.github/workflows/main.yaml:29comment claiminge2e.yamlcoversmainpushes (it isworkflow_dispatch+scheduleonly);bazel/img/go_multi_arch_image.bzl:69-77stop declaringadditional_layerwhenimage_tars_layeris unset (four dangling targets). - A2 the race the detector caught + CI race gate:
registry/internal/etcd/etcd.go:569/:200—Closecancels the watch ctx then nilsclient/watchCancelwithout waiting forwatchLoop; add adonechannel closed bywatchLoop, wait on it inClose, never nilclient(oratomic.Pointer), guard doubleClose. Fix the three test-only races that fail deterministically under--config=race:registrar/internal/server/server_test.go:26(mutex on the fake stream +snapshot()accessor),prober/internal/prober/prober_test.go:312(NewUnstartedServer, setConnState,Start),common/xds/callbacks_test.go:23(atomic.Bool).cni/internal/util/watcher.go:80blocking send with no ctx/quit case (the one select loop with no stop path). Then add aracejob toci.yaml:bazel test --config=raceover the whole tree (169 s measured) plus--runs_per_test=3on the 19 concurrency-heavy packages, in thecifan-in. - A3 shared-cache mutation:
agent/storagehands out cached protos whose RWMutex guards the map, not the values —cni/server/termination.go:114andliveness.go:95mutate them in place. EitherGetAll/Getreturnproto.Cloned values (simplest, measure the cost — the CNI server's pod table is small) or the type documents immutability and the two call sites copy-on-write. Same class inregistry/internal/registrar.go:377/397vs:921/:935: cached endpoint slices escape the lock and are appended/mutated by consumers (xds/cache/cluster.go) → return copies. Add-racetests that interleave the goroutines involved (the detector only finds what a test exercises). - A4 determinism (fix(agent): make cluster/CLA protos deterministic to stop spurious CDS churn #135 redux on RDS):
agent/internal/xds/cache/cluster.go:93andcapture.go:484/535build thecap_http/aether_outboundvirtual hosts in map-iteration order;l4route.gopicks the UDP primary cluster by map order.sort.Sliceper builder, plus a determinism test in the style of the fix(agent): make cluster/CLA protos deterministic to stop spurious CDS churn #135 fix (build twice from shuffled inputs, compare bytes). Validate: xDS push counters/RDS version churn should drop on talos. - A5 supervisor: proxy-supervisor: shutdown admin probe runs on the already-cancelled ctx, so SIGTERM may never drain Envoy (needs reproduction) #771 — reproduce first (unit + delete-pod on talos), then fix the probe ctx and the missing deadline, then the four epoch-bookkeeping findings and the tmp-file/fsync item. Own PR, hitless-rollout + delete-pod validation, coordinate the cluster window.
- A6 lock-scope and ordering fixes (split by blast radius):
- A6a
agent/internal/spire/bridge.go:615— serialisepushSecrets(build-then-publish is last-writer-wins; an out-of-order publish can drop a live secret) and the bundle-map rebuild in the same file that can leave zero validation contexts. Inside the open Transient cross-service mTLS identity mis-binding during concurrent proxy-restart + service roll (failed closed) #638 blast radius → validate with the Transient cross-service mTLS identity mis-binding during concurrent proxy-restart + service roll (failed closed) #638 discriminator counters flat across a proxy roll. - A6b
agent/internal/cni/server/ghostsweep.go:229-269— the whole sweep runs underlifecycleMuwith untimed registry + Eviction API calls; give the RPCs deadlines and shrink the critical section to the map mutation (credible mechanism for CNI DEL timeouts → stale netns, fix(agent,proxy): prune stale-netns pods + supervisor crash-fast-fail #245). - A6c
common/fileAtomicWriteReader:88— fsync the file before rename and the directory after (it writes the mesh-DNS snapshot and the CNI conflist, the two artefacts whose loss caused the 2026-08-29 outage); same for the supervisor's executable copy. - A6d
registry/internal/registrar.go:488vs:505— lost watch-filter re-assert (shape of the demand-scoped TTL expires under continuous load and ODCDS re-discovery stalls ~5 min: 5-minute per-node outages on nodes with no local replica, invisible to soaks #682 stall) and theDiff/ReplaceTOCTOU currently masked by the write-behind overlay;agent/internal/node+controller/internal/nodetaint— both taint writers still use non-optimisticMergeFrom(residual of fix(agent): hold xDS, hold the taint, and mean it when identity is ready (#740) #743): switch toMergeFromWithOptions(client.MergeFromWithOptimisticLock{}).
- A6a
- A7 flaky: replicator e2e — endpoint withdrawal >30s when the designed path is watch-speed (sub-second) #597 replicator flake:
TestReplicator_LeaseHandoffKeepsMirrorAlivewatches through the predecessor's TTL expiry with a 6.7–10 s margin whilestartReplicatornever setsDialTimeout(default 5 s) — set a 500 msDialTimeoutin the test, do the lease hop in a singleclientv3.Txn, and gate the watch loop on the synced revision. Close flaky: replicator e2e — endpoint withdrawal >30s when the designed path is watch-speed (sub-second) #597 on 20/20 green runs. - A8 duplicated production code:
buildL4Backendsexists twice (agent/internal/l4route/reconciler.go:466,agent/internal/edge/gatewayapi/reconciler.go:946) with duplicated tests; unify incommon/gammaproject(or a newcommon/l4project), then the tests collapse. Data path → hitless validation.
Phase B — binary size (independent of A except B2)
- B1
cni/cmd/cni-install/main.go:6andprober/cmd/prober/main.go:7import controller-runtime only forctrl.SetupSignalHandler(); replace withsignal.NotifyContext(pattern atagent/cmd/mesh-dns/main.go:133, incl. the exit-on-second-signal behaviour), optionally hoisted tocommon/signals. Moveprober/internal/cmd/root.go:8offcontroller-runtime/pkg/log/zapontocommon/log(slog;prober.Newtakes*slog.Logger). Expected: cni-install 25 → ~7 MiB (66 → 10 modules), prober 40 → ~16 MiB (79 → ~23). Check LogsQL/alert rules that grep prober log lines before merging (JSON keys change). - B2 split
agent proxy-supervisorinto//agent/cmd/proxy-supervisor(the proxy pod runs the 65 MiB agent to supervise a child; the hot-restart code needs 22 modules, the only coupling isagent/internal/cmd/supervisor.go:56 manager.SetupLogging). Precedent: proxy readiness probe re-execs the whole agent binary every 2s: >=31% of supervisor CPU is Go package init #673 carved outproxy-ready. Chart change (image/command), hitless validation. Do after A5. - B3 later, lower value:
common/xds→common/xds/envoyxdsso plain gRPC servers (registrar) stop linking go-control-plane; CNI plugin telemetry via the agent's UDS RPC instead of an OTLP gRPC pipeline per ADD/DEL (255 → 198 packages, and CNI ADD latency).
Phase C — tests
- C1 delete
//agent/internal/cni/server:server_integration_testand//agent/internal/xds/server:server_integration_test(strict subsets of the sibling:server_test; they run twice and schedule theintegrationCI runner for nothing); guardregistry/internal/etcd/etcd_test.go:21 TestMainwithtesting.Short()before starting the container; rename/delete the misnamedagent/internal/xds/proxy/edge_test.go:859; replace the 11time.Sleepinregistrar/internal/server/sync_test.gowithrequire.Eventually. - C2 shared helpers:
common/telemetry/telemetrytest(ManualReader install +Sum/Gauge/HistogramCount/SumByAttr; replaces 20 copies in 11 packages, ~310 LOC — never a package-level singleton provider),common/log/logtest(locked buffer +Records/Find/Level, 5 copies),registrytest.Fake(nil-embeddedregistry.Registry+ListAllFunc, keeping the cache test'stcpAwarescoping as an explicit option), and runregistrytest.RequireNamespaceQualifiedKeys+RequireProtocolDisjointfrom the etcd and registrar tests (today only kubernetes runs the contract). - C3 smaller:
common/readymarker/readymarkertest(per-binary ceilings and forbidden lists stay),registry/etcdtestbootstrap (one image pin), a variadic scheme builder for the 14NewScheme+AddToSchemesites,k8s.io/utils/ptrinstead of 11 localptrhelpers, defaultcontainer_test.yamlin the image macro (agent keeps its override),cmdtest.RequireFlagsRetired. - C4 delete
e2e/config/(543 lines, unreferenced since Jan 2026) and thesvc-0..3half ofe2e/Makefile:generate-certs; decide whethere2e/multicluster_config.sh(the only 026 harness, never run by CI) gets ane2e.yamljob. - Explicitly not consolidating: container-sharing across test targets,
cache/edge_test↔proxy/edge_test,common/spire↔agent/internal/spireassertions, the*-ready:deps_testtargets, Go e2e ↔ shell harnesses, inline discard loggers, endpoint literals, splitting the big cache/proxy targets.
Phase D — dead code (~250–300 LOC total)
- D1
agent/internal/xds/proxy/projection.goToConfigProjection/gammaRouteToProto/headerMutationToProto— a second GammaRoute→proto encoder that shadowscommon/gammaproject; nothing in production calls it and its round-trip test guards a path nobody takes. Remove and rewriteprojection_test.goto round-trip the realgammaprojectoutput. Plusedge/gatewayapi/attachment/refs.go:178 firstBackendService(+4 test assertions) andexternalHTTPSPort. - D2
common/spire/tls.goNewSource:65,ServerTLSConfig:112,SourceTimeout— unreachable since agent: startup is fatally coupled to the SPIRE Workload API — a 25 s SVID wait exits the process (2–4 restarts per node on every cold boot; #662 family) #740'sWaitingSource; separate PR because it is the identity path. - Keep:
meshdns.WithInstanceID(documented test seam),meshdns.NewServer(2-line wrapper),Http1ProtocolOptions(needs-check), the two--readiness-checkcompat flags (product decision; add cobraMarkDeprecatedso they warn).
Phase E — docs (~135 lines / 16 files)
- E1 wrong facts (~40 lines, trivial):
agent/internal/meshdns/server.go:1-6name shape + forwarding attribution;common/constants/annotations/annotations.go:23retired--capture-redirect-all;docs/proposals/035:3and021:3status lines;controller/internal/podmutate/mutator.go:14ndots "opt-in";registry/internal/k8s/kubernetes.go:103,108port 15008 / "ddb";CLAUDE.md:11Go 1.26.x,:61"undercmd/", theregistry/internal/ddbmention;charts/README.md:46,88-91versions;agent/internal/gamma/reconciler.go:1-5;AGENTS.md:81controller SPIRE default;docs/observability/README.md:12-20missing alert;proxy/README.md:55→proxy-release.yml;docs/conformance/gateway-api-features.md:11"0.41.0". - E2 document what shipped (~95 lines, needs a decision on depth):
docs/configuration.mdprober section,--lame-duck-max,--spire-wait-warn-after, the 28 undocumented values keys (14 areedge.config.*); CLAUDE.md/AGENTS.md:prober/cmd/prober,agent/cmd/proxy-ready,agent/cmd/mesh-dns-ready,common/spire,controller/internal/nodetaint+agent/internal/node,agent/internal/cniconflist,registrar/internal/replicator,agent/internal/identity, nogo, thedeps-auditandraceCI jobs.
Suggested sequencing
Week 1: A1, A2, E1 (all small, no cluster risk) and the #771 reproduction. Week 2: A3, A4, A6b/c/d, C1, D1/D2, B1. Then the cluster-validated set one at a time: A5, A6a, A8, B2. C2–C4 and E2 whenever convenient. Each PR references this issue and the sub-issue where one exists (#770, #771, #597).
🤖 Generated with Claude Code
Activity
fix(build,chart): review hazards — authz failureMode guard (#770), bu…
chore: remove the shadow GAMMA export encoder and superseded SPIRE TL…
fix(replicator): bound LeaseGrant on the peer, batch syncFull puts-be…
docs: correct stale facts found by the 2026-09-15 review (#772) (#773)
fix(common/file): fsync the file before the rename and the directory …
fix: etcd Close/watchLoop race, CNI watcher stop path, test races, an…
perf: drop controller-runtime from cni-install and prober (25→5 MiB, …
fix(xds): make every map-derived xDS resource byte-stable (#772, A4) (#…
fix(registrar,node): copy cached endpoints out of the lock, never los…
fix(storage,cni): storage owns its values; bound and unwind the ghost…
refactor(l4route,edge): one shared L4 backendRef projector in common/…
fix(agent): make SPIRE bridge SDS publication monotonic (#772) (A6a) (#…
fix(proxy-supervisor): probe the admin endpoint on a detached ctx at …
fix(proxy-supervisor,chart): bound the mid-handoff wait by the pod's …
5 remaining items
test: drop duplicate integration targets, Docker-free -short for etcd…
ci: make the control_plane path filter's negations effective (#772) (#…
perf(proxy): split the hot-restart supervisor out of the agent binary (…
perf(proxy): split the hot-restart supervisor out of the agent binary (…
fix(registrar): make the filter re-assert test deterministic (#772) (#…
bpalermo commentedon Sep 16, 2026
All phases executed and deployed (rev214 = 0.92.22-a607a04 on talos-main, 2026-09-16).
Merged: A1 #774 (closes #770) · A2 #776 · A3/A6b #782 · A3/A6d #781 · A4 #780 · A5 #785 (closes #771) · A6a #784 · A6c #779 · A7 #778 (#597 stays open: it is about the e2e harness) · A8 #783 · B1 #777 · B2 #790 · C1 #788 · D #775 · E1 #773 · E2 #787 · follow-ups #789 (CI control_plane filter, proven by throwaway #792) and #793 (test ordering).
Deploy validation: roll hitless (0 prober errors fleet-wide, 0 restarts, 0 ERROR lines, 5/5 hot restarts, lame duck 5/5 successor, #638/SDS counters flat, xDS churn settled, #770 fail-closed end-to-end, images −35%/−48%/−64%). Two findings tracked separately: #795 (delete-pod/drain/eviction now costs ~8 s on the node because #785 removed the accidental successor wait — fix in progress) and #796 (roll wedge on a CPU-saturated node: edge maxSurge → proxy preemption → CNI DEL fails without the agent socket). Not exercised: L4 TCP/TLS/UDP paths (no routes deployed, no CI e2e) — see #783.
fix(supervisor): on SIGTERM wait (bounded) for the surge successor be…
fix(build): stamp OCI provenance on every published image, and record…
fix: OCI provenance labels on every published image (#837), and make …
fix(e2e): give the uds harness the proxy-supervisor image (#860) (#861)
feat(agent): register and promote under every protocol key (037 Phase…
feat(agent): register and promote under every protocol key (037 Phase…
chore: remove the expired deprecated shims — agent proxy-supervisor a…
docs(website): the site describes the mesh as it is now: TPROXY captu…