Repository navigation
Description
Summary
The node agent's startup hard-depends on the OTel collector accepting exports. When the collector is shedding (data refused due to high memory usage), the agent's export blocks past its startup deadline, the startup context is cancelled, SPIRE Workload API source creation fails, and the process exits 1 — so the agent crash-loops and the node loses its xDS control plane. A telemetry backend under memory pressure should never be able to stop the data plane from starting.
Observed live on talos-main during the 2026-09-02 soak (rev189/0.91.3-d22cf05), on 3 of 5 nodes during a rolling restart:
starting aether agent
exporter export timeout: rpc error: code = Unavailable desc = data refused due to high memory usage
ERROR failed to shutdown telemetry: context canceled
Error: failed to create SPIRE Workload API source: context canceled
Kubelet on the same nodes: Readiness probe failed: .../readyz: context deadline exceeded → Liveness probe failed → Container agent failed liveness probe, will be restarted.
Restart counts at 06:08Z: w05 0, w01 0, w03 1, w04 2, w02 5 and still 0/1 CrashLoopBackOff — i.e. it does not reliably self-recover while the collector stays saturated; worker-02 sat with no agent for minutes. It recovered only after the soak load was torn down and collector pressure fell.
Why this is a product defect, not just an o11y incident
The collector saturation had an external cause (see context below), but the coupling is ours:
- Blocking startup on a telemetry export makes an observability component a hard dependency of the data plane. The agent programs Envoy; if it cannot start, that node's mesh config goes stale and new pods on it get no listeners.
- The failure is correlated across the fleet. Every agent exports to the same collector, so a shedding collector can take out every node's agent at once — precisely during a rolling restart, when they all start simultaneously. This is the same class of fleet-wide correlated failure as agent: ghost-sweep prune needs a mass-delete circuit breaker (power-blip incident 2026-07-19) #566/CNI boot race: pods restarted before cni-install come up unregistered — no self-heal, total mesh outage after node reboot #640.
- It converts back-pressure into a crash loop. Shedding is the collector working as designed (memory_limiter); the correct agent response is to degrade telemetry, not to die.
Expected behaviour
Telemetry must be best-effort and off the startup critical path:
- Never block agent startup on a successful export. Initialize the exporter asynchronously, or bound it with a short timeout whose expiry is logged and otherwise ignored.
- Failure to export must not cancel the startup context used by SPIRE/xDS/CNI initialization. (The visible error is
failed to create SPIRE Workload API source: context canceled— the telemetry failure is cancelling an unrelated dependency's context, which suggests one shared context where two are warranted.) - Consider whether
readyzshould depend on telemetry at all; a node agent that can program Envoy but cannot export metrics is degraded, not unready.
Where to look
agent/internal/cmd/root.go startup sequence (telemetry setup vs SPIRE source creation and their shared context), and common/telemetry/setup/. Check the OTLP exporter's configured start/export timeout and whether the error path is fatal.
Repro
Saturate the collector (or point the agent at a collector returning Unavailable/ResourceExhausted), then restart the agent DaemonSet. Expect: agents fail startup and crash-loop. Desired: agents start, log a telemetry warning, and serve xDS.
Context
- Collector was at 729Mi/675Mi against a 1Gi limit, well above the ~563MiB soft shedding threshold (
limit% − spike% = 80% − 25%), withOtelCollectorRefusingDatafiring and unresolved from 04:14Z onward. - Root trigger of the saturation was node pressure on main-worker-01 (which hosts Prometheus, Alertmanager, Tempo, etcd, spire-server, Pyroscope and the soak harness's single
echoreplica) — tracked separately; it is the trigger, not the defect.
Activity
fix(agent): decouple startup from OTel export so a shedding collector…
fix(agent): gate taint removal and agent readiness on CNI conflist ch…
test(pressure): collector-shedding harness to exercise #662's startup…
bpalermo commentedon Sep 5, 2026
Deliberately reproduced the shedding condition — the fix holds. PASS.
Four soaks never got the collector above ~22% of its memory limiter, so #668's decoupling was "not disproven", not proven. Today it was exercised on purpose with the
e2e/pressureharness (#690) against the production collector on talos-main (rev194, cc44d69), 2026-09-05 14:14–14:16Z.Pressure:
telemetrygenflooding the logs pipeline at ~96 MiB/s aggregate.memory_limiter(80/25 on a 2Gi limit, GOMEMLIMIT 1638MiB) engaged at 14:15:09Z:otelcol_receiver_refused_metric_points_total+8,784,refused_log_records+995, collector RSS 1,644MiB. This is the same "data refused due to high memory usage" state that on 09-02 crash-looped 3 of 5 agents (w02 reached 6 restarts) and cost a node its xDS.Under that condition the harness deleted the agent on main-worker-03:
aether-agent-wrnhf)aether-agent-9qjms)waiting for the SPIRE Workload API to issue this agent's SVIDresolved workload trust domain from SPIRElocal storage is ready, starting managerCNI conflist re-assert loop startedrestartCountfailed to create SPIRE Workload API source[]on all fiveThe only ERROR-level line in the new agent's log is
registrar/registrar.go:463 failed to start watch stream, retrying — rpc error: code = Canceled desc = context canceledat 14:15:30.929Z, which the client retried and recovered from on its own. It is not on the startup critical path and it is not the #662 failure (filed separately as a small observation). The harness graded FAIL on it because its criterion is "any ERROR containingcontext canceled", which is broader than #662's signature — being fixed in the harness (follow-up issue).Conclusion: agent startup is decoupled from OTel export under real collector shedding. SPIRE source creation, storage readiness and the manager start all completed while the collector was refusing data; telemetry export failure is best-effort as #668 intended.
Also observed, for the record: the collector itself survived four floods today with peak RSS 1,743MiB (85% of the 2Gi limit, above GOMEMLIMIT) and 0 restarts —
memory_limitersheds rather than OOMs, as designed. And the limiter's trigger is on Go heap (~1,126MiB), which corresponds to RSS ≈1,250–1,650MiB depending on GC phase; every soak record's "≈1126MiB soft threshold vs RSS" comparison has been conservative by that ratio.Closing. Runs: harness runs 1–4 in this session (run 1 under-powered at 64 MiB/s, runs 2–3 aborted on the harness's RSS ceiling after shedding had in fact engaged per Prometheus, run 4 with the ceiling at 1,850MiB produced the observation).
fix(e2e): abort the pressure harness on heap vs GOMEMLIMIT, narrow th…
bpalermo commentedon Sep 7, 2026
Same failure shape, different dependency: agent startup is also fatally coupled to the SPIRE Workload API (observed 2026-09-07)
#668 fixed the OTel-export coupling, and it held — there was no OTel-driven crash loop in this event (
otelcol_receiver_refused_metric_points_totalincrease over the window: 0; collector RSS 262/260 MiB). But the 2026-09-07 talos-main power failure reproduced exactly this issue's shape against a different startup dependency, so recording it here rather than losing it.All 6 nodes cold-booted 15:50:48–15:50:51Z. Every agent then crash-looped 2–3 times.
kubectl logs --previousis identical on all of them:(w01 and w03 show
context canceled, w05context deadline exceeded— same path, different race point.)Restart counts per node: w01 3, w02 1, w03 3, w04 3, w05 4. The agent hard-exits (exit code 1) when the 25 s SVID wait expires, so the node has no xDS and no CNI registration server until CrashLoopBackOff happens to retry after SPIRE is up.
Upstream cause — and it is a third occurrence of its own pattern.
spire-server-0crashed twice with a fatal plugin-configure error:The IRSA OIDC issuer is served by this cluster (
irsanamespace,irsa.palermo.devHTTPRoute), so at cold boot spire-server races its own OIDC provider, andaws_kmstreats the transient 400 as fatal. spire-server only became healthy at 16:00:35Z; agents came up 16:01:16–16:02:45Z. Same family as the 2026-08-29 spire-server IRSA-injection race — "SPIRE depends on something that isn't up yet at boot" has now bitten three times.Impact was bounded (it is self-limiting — backoff eventually wins, and #641's eviction pass then re-meshed everything by 16:03:59Z, full SLI recovery 16:07Z), but it adds ~60 s to every node's post-boot mesh readiness and burns 2–4 restarts per agent on every power event, which is precisely the cost #662/#668 set out to remove.
Suggests the #668 treatment generalises: no external dependency should be able to turn agent startup into a process exit. Waiting for the SVID with retry-in-place, rather than
Error:→ exit 1, would make a cold boot a slow start instead of a crash loop. Filing as a new issue if you'd rather track it separately — flagging here first because it is the same defect class this issue named.Full record:
project_incident_power_failure_20260907.md.chore: remove the shadow GAMMA export encoder and superseded SPIRE TL…
fix(proxy-supervisor): probe the admin endpoint on a detached ctx at …
fix(supervisor): probe on a detached ctx, bound the successor wait by…
fix(e2e, docs): the pressure run reads a failed kubectl or curl call …
chore(e2e): the collector-pressure test leaves this repository; it is…