Skip to content

fix(soak): churn.sh explicit --context, pre-flight before T0, abort on first FAILED roll (#951) - #977

Merged
bpalermo merged 1 commit into
mainfrom
fix/churn-context
Sep 27, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/churn-context

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Closes #951

On 2026-09-26 churn.sh ran 58 minutes with zero rolls because ~/.kube/config had no current-context (kind delete cluster cleared it). Every bare kubectl rollout restart hit localhost:8080, the driver logged FAILED and kept its schedule, and the soak looked healthy from every dashboard.

Changes

  • Explicit context: --context NAME (or SOAK_CONTEXT), default talos-main. Every kubectl call goes through k(), which passes --context "$CTX". The positional BUILD_LABEL is unchanged. sample-proxy-rss.sh gets the same flag, and churn.sh passes its own context to it.
  • Pre-flight before T0 and before the log is touched: get --raw /readyz, then for every workload the schedule rolls (agent/proxy/mesh-dns DaemonSets, aether-edge, svc-1..5) plus the SHRINK target, the object must exist and auth can-i patch must pass. On any failure it prints to stderr and exits 2. $LOG is neither archived nor truncated and no T0 line is written. --preflight runs only this check, so the launch can be loud in the foreground.
  • Fail fast: the first FAILED roll logs CHURN ABORTED: ... and exits 1. The same applies to a SHRINK that cannot read, scale or restore, and to an unknown kind. TRIPLE statuses are now waited per PID, because wait a b c only returns the last status. On abort, queued RSS samplers are killed and the EXIT trap restores the shrink.
  • README "Run": a foreground --preflight, then the detached launch with --context talos-main, a head -2 launch check, and the abort semantics. It also keeps the note that kind delete clears the current-context.

Existing log lines (ROLLED, FAILED, RSS SAMPLE, no-roll window, SHRINK, churn driver start T0=... build=..., churn driver complete) are unchanged. The context goes on its own second line (churn driver context=...), so build= still runs to end-of-line. The absolute-path pgrep guard is kept.

Validation

  • bash -n on both scripts. bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //e2e/... is green. To check the gate isn't vacuous, I added an unquoted $1 to churn.sh: //e2e/soak:soak_shell failed with SC2086, then passed again after the revert. //:format.check is clean.
  • Pre-flight dry run against a wrong context with a temp SOAK_CHURN_LOG containing a sentinel line. It exits 2 and the file's md5 is unchanged (not archived, not truncated). /tmp/soak-churn.log mtime is also unchanged:
    churn.sh: PRE-FLIGHT FAILED: context 'does-not-exist' cannot reach a ready API server:
      error: context "does-not-exist" does not exist
    churn.sh: refusing to start; <tmp>/churn-dry.log untouched, no T0 written. Check `kubectl config get-contexts` and pass --context.
    exit=2
    
  • Full schedule against a fake kubectl/sleep on PATH (no cluster contact):
    • Passing run: 31 ROLLED, SHRINK begin/done, churn driver complete, exit 0.
    • Failing rollout: FAILED aether-test/deployment/svc-1, then CHURN ABORTED: roll failed: aether-test/deployment/svc-1 -- stop, fix, relaunch with a fresh T0 (context=fake), exit 1, and no later rolls.

Note: the running soak uses the main checkout's copy of churn.sh. Per the README, don't pull this into that checkout until the run ends.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…0, aborts on the first FAILED roll (#951)

On 2026-09-26 the churn driver ran 58 minutes with zero rolls: ~/.kube/config
had no current-context (kind delete cluster cleared it), every bare
`kubectl rollout restart` hit localhost:8080, and the driver logged FAILED per
roll and kept its schedule while k6 and the prober made the soak look healthy.

- churn.sh: `--context NAME` / SOAK_CONTEXT (default talos-main); every kubectl
  call goes through `k()` which passes --context. Positional BUILD_LABEL kept.
- Pre-flight before the log is touched and before T0: /readyz, every workload the
  schedule rolls plus the SHRINK target must exist, and `auth can-i patch` each.
  Any failure prints to stderr and exits 2 with $LOG neither archived nor
  truncated. `--preflight` runs only the check, for a loud foreground launch.
- Fail fast: the first FAILED roll (TRIPLE statuses are now waited per PID), a
  SHRINK that cannot scale/restore, or an unknown kind logs `CHURN ABORTED` and
  exits 1; queued RSS samplers are killed and the EXIT trap restores the shrink.
- sample-proxy-rss.sh: same --context / SOAK_CONTEXT; churn.sh passes its own.
- README "Run": foreground --preflight then detached launch with
  --context talos-main, head -2 launch check, abort semantics.

Log lines (ROLLED, FAILED, RSS SAMPLE, no-roll window, SHRINK, churn driver
start T0=, churn driver complete) are unchanged; the context is logged on its
own second line so the start line's build= field still runs to end-of-line.

Closes #951

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 757468e into main Sep 27, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/churn-context branch September 27, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

soak churn.sh silently no-ops when kubeconfig has no current-context: every roll FAILED for 58 min and the run looked alive

1 participant