Repository navigation
fix(e2e): abort the pressure harness on heap vs GOMEMLIMIT, narrow the FAIL criterion (#699) - #714
Merged
Merged
Conversation
…e FAIL criterion (#699) Four runs against talos-main on 2026-09-05 exposed two defects in the #662 collector-shedding harness. 1. The abort ceiling sat below the point the limiter actually engages. memory_limiter triggers on the Go heap, and refusal onset was measured at 1,077-1,300MiB heap while RSS at that same instant was 1,250-1,650MiB (GC slack runs RSS 1.15-1.4x ahead). The fixed 1,500MiB RSS ceiling therefore landed inside that band: runs 2 and 3 aborted after shedding had engaged but before the poll observed it. The primary ceiling is now heap against GOMEMLIMIT (95%, read off the live pod's env, falling back to the container memory limit when it is derived), with RSS kept only as a cgroup-OOM backstop at 90% of the pod limit. Both are derived at run time instead of hard-coded, so a resize of the o11y plane cannot silently invalidate them; the soft/hard limiter thresholds are likewise derived from limit_percentage/spike_limit_percentage. The counters and gauges are now read from the collector's own :8888/metrics over one port-forward per replica, which removes the scrape lag that made the poll miss the onset. The deployed collector does not currently serve :8888 -- its service.telemetry.metrics has only a periodic OTLP push reader -- so --metrics-source auto detects that, warns, and falls back to Prometheus at a 15s poll; the README carries the GitOps snippet that opens the pull reader. Metric names are matched tolerantly across otelcol_processor_memory_limiter_refused_* (what 0.159.0 emits), otelcol_processor_refused_* and otelcol_receiver_refused_*. Collector replica discovery reads the Deployment's own .spec.selector: the otel-scraper Deployment shares app.kubernetes.io/name=opentelemetry-collector and would otherwise have folded a second process into the sums. 2. The FAIL criterion was broader than #662. Run 4's agent came Ready in 16s with 0 restarts and SPIRE resolved -- the #668 fix held -- but the harness printed FAIL over one self-recovering client retry logged at ERROR (`failed to start watch stream, retrying` / `context canceled`, tracked in #700). FAIL is now exactly #662's signature: `failed to create SPIRE Workload API source`, a container exit (restartCount > 0, a terminated previous container, or CrashLoopBackOff), or the trust-domain resolution never being logged. Every other ERROR line is listed as informational. Also adds --dry-run, which resolves GOMEMLIMIT, the pod limits, the thresholds and the metrics source, prints the plan and the current readings, and exits without applying the Job or touching an agent. The README now records the observed numbers so nobody re-derives them (heap trigger ~1,126MiB = RSS 1,250-1,650MiB, limiter caps RSS at ~1,743MiB on the 2Gi pod, 0 collector restarts across four runs) and warns that rate() over the prober SLI under-reads during shedding (12-18/s against a real 25/s) because of export lag on cumulative counters that self-heal -- not lost requests. Validated: shellcheck clean, make format-check clean, --dry-run exercised against talos-main on two nodes (resolves GOMEMLIMIT=1638MiB -> 1,556MiB heap ceiling and 2Gi -> 1,843MiB RSS backstop), --metrics-source collector correctly exits 2 while :8888 is closed, and parse_bytes/agg_samples unit-tested against a synthetic exposition fixture. The harness itself was NOT run against the cluster. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…eaches shedding (#699) Two of two runs at 2 pods x rate 2 on 2026-09-05 timed out at 300s with the collector heap at 10% of GOMEMLIMIT and zero refusals; every run that reached shedding used 3 x 3. Corrects the arithmetic (144MiB/s aggregate, ~72MiB/s per replica, ~70% of the limiter's spike frontier) and the observed numbers from the fifth run (heap peak 1,497MiB = 91% of GOMEMLIMIT, RSS peak 1,766MiB, 0 restarts). 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]> 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.
Fixes #699. Harness-only change (
e2e/pressure/); no product code touched.1. Abort on heap vs
GOMEMLIMIT, not RSS vs a hard-coded numbermemory_limitertriggers on the Go heap. The four runs on 2026-09-05 measured refusal onset at heap 1,077–1,300 MiB while RSS at that same instant was 1,250–1,650 MiB — GC slack runs RSS 1.15–1.4× ahead of heap. The old fixed 1,500 MiB RSS ceiling therefore sat inside that band, and runs 2 and 3 aborted after shedding had engaged but before the 15 s poll saw it.GOMEMLIMIT, read off the live pod's envGOMEMLIMIT=1638MiB)resources.limits.memoryIf
GOMEMLIMITis derived (valueFrom: resourceFieldRef) or absent, it falls back to the container memory limit and says so. Thememory_limitersoft/hard thresholds are likewise derived fromlimit_percentage/spike_limit_percentageat run time rather than hard-coded, so resizing the o11y plane cannot silently invalidate them.Reading the numbers without scrape lag
Counters and gauges are now read from the collector's own
:8888/metrics, onekubectl port-forwardper replica — the scrape lag was why the poll missed the onset.:8888. Itsservice.telemetry.metricshas only aperiodicOTLP push reader (30 s interval), nopullreader, so nothing listens on 8888.--metrics-source auto(default) detects this, warns loudly, and falls back to Prometheus at a 15 s poll — which is honest but still 30–60 s stale. The README carries the exact GitOps snippet that opens the pull reader; once that lands the harness picks it up automatically and drops to a 5 s poll.--metrics-source collectorforces it and exits 2 rather than silently degrading.Metric names are matched tolerantly, with and without
_total, acrossotelcol_processor_memory_limiter_refused_*(what the deployed 0.159.0 actually emits),otelcol_processor_refused_*andotelcol_receiver_refused_*. heap/RSS are the max across replicas (each is a per-process limit), refused counters the sum.Also fixed while wiring this up: replica discovery reads the Deployment's own
.spec.selectorinstead ofapp.kubernetes.io/name=opentelemetry-collector, which the single-replicaotel-scraperDeployment shares — it would have added a bogus port-forward and folded a second process's counters into the sums.2. FAIL narrowed to #662's signature
Run 4's agent came Ready in 16 s with 0 restarts and SPIRE resolved — #668 demonstrably held — yet the harness printed FAIL because the new pod logged one self-recovering client retry at ERROR (
registrar.go:463 failed to start watch stream, retrying…context canceled, tracked separately in #700).failed to create SPIRE Workload API sourcein the logrestartCount > 0, a terminated previous container, orCrashLoopBackOffresolved workload trust domain from SPIREnever loggedERRORline — printed (first 20), not gating the verdict3.
--dry-runResolves
GOMEMLIMIT, the pod limits, the abort thresholds and the metrics source, runs the full read-only pre-flight, prints the plan and the current readings, and exits 0. Applies no Job, touches no agent.4. README
Records the observed numbers so nobody re-derives them: heap trigger ≈ 1,126 MiB ≈ RSS 1,250–1,650 MiB, limiter caps RSS at ≤ 1,743 MiB on the 2 Gi pod, 0 collector restarts across four runs, 1–4 min from apply to shedding. Adds a new What counts as a FAIL section, and a risk-section warning that
rate()over the prober SLI under-reads during shedding (12–18/s against a real 25/s) — that is export lag on cumulative counters that self-heal, not lost requests, and nothing should be graded off arate()spanning the window.Validation
The harness itself was not run against talos-main — it floods the shared collector, and the main session runs it once before tonight's soak.
shellcheck e2e/pressure/run.sh— clean;make format-check— clean.--dry-runexercised againsttalos-mainon two nodes: resolvesGOMEMLIMIT=1638MiB→ 1,556 MiB heap ceiling, 2 Gi → 1,843 MiB RSS backstop, discovers exactly the 2 real collector replicas, and correctly reports the:8888fallback. No Job applied, no agent touched, no residue.--metrics-source collector --dry-runexits 2 with a clear message while 8888 is closed.parse_bytesand the exposition-format aggregator unit-tested against a synthetic/metricsfixture (1638MiB/2Gi/1.5GiB/bare bytes/bogus units; scientific-notation gauges; max-vs-sum; the_accepted_decoy series correctly ignored) — the:8888code path is validated even though the endpoint is not yet open.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr