Skip to content

fix(soak): the watchdog leaves no orphan, a Job that dies at once is still saved, and the harness moves to sortie f0750ec (#1386, #1387, #1388) - #1417

Merged
bpalermo merged 1 commit into
mainfrom
fix/soak-watchdog-saver-sortie-f0750ec
Oct 8, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/soak-watchdog-saver-sortie-f0750ec

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #1386
Closes #1387
Closes #1388

An agent wrote this pull request. Three fixes to the soak harness (e2e/soak/) and its proposal, and the move to the newest sortie release, in one change because they touch the same files and tests.

What changed

The restart watchdog leaves nothing behind (#1386). restart-watch.sh waited between samples with sleep N &, SLEEP_PID=$!, wait "$SLEEP_PID", and a trap that killed $SLEEP_PID. Two moments left the sleep running:

  • a TERM between the first two commands, when the variable is still empty (the one the issue describes);
  • a TERM just after them: the trap sends its kill and the sleep is sometimes still there.

The wait now has no child process at all: read -t on a private fifo, in two-second slices. TERM and INT are also trapped from the script's first line, so a kubectl call in the foreground is waited for instead of orphaned (this matters for --preflight, which had no trap).

A Job that ends at once is still saved (#1387). run.sh arms the saver the moment the Job has a name, before it polls the pod at all. If the pod has already ended, the kickoff still aborts, but it waits for the saver (up to 120 s) and the abort line says what the saver got: the report (with the gate command), or, when no report could be saved, the saver's own line (which names the results stream and how to grade it).

sortie f0750ec. Chart sha256:b1f0a6d5…, driver sha256:3d9a9b67…, engine sha256:d0fbc860…, resolved from the registry and verified with the repository's pinned cosign (v3.1.2): the chart, and the index and both per-arch manifests of each image, bound to the commit. scripts/check-registry-config.sh passes.

  • sortie-gate.sh now knows a stage refused at the execution cap by sortie's new "refused": "execution_cap" field, not by its error text. Inside such a stage it can now tell an engine that refused from a backend that was lost.
  • One fallback is kept: an execution with no refused field at all is read by its error text. That is the shape of a sortie 9fcbb81 report, and those are still graded with this gate (talos-main run 4 and the first soak are 9fcbb81 reports).

Docs. The README and proposal 042 say that a statsd total is never one run's count and must be read with rate() / increase(). Proposal 042 records talos-main runs 3 and 4 and the first 8-hour soak (#1388), the kind runs against f0750ec, and updates the risks and open questions those runs answer.

The engine digest question

The sortie session said the engine is unchanged from 9fcbb81 and quoted sha256:d0fbc860…, while the harness pinned sha256:99d5058c… for 9fcbb81. Both are right. Read from the registry:

  • both are image indexes, one per commit; it is not an index-versus-per-arch mix-up;
  • on amd64 and on arm64 the two images have the same 22 layers, digest for digest;
  • the configs differ in one label, org.opencontainers.image.revision, which is the commit.

So every digest changes with every sortie commit. The pin is what the f0750ec chart names; the old engine index does not verify against the new commit.

Evidence

Red, then green, for each new condition (old scripts under the new tests: 19 failures; new scripts: all pass, 60 of 60 runs under Bazel).

what red green
#1386, every command boundary old script: TERM before command 122, SLEEP_PID=$!: exit 143, left behind: sleep 3600 every time, and in some runs also before wait "$SLEEP_PID" TERM before each of 134 commands: exit 143, session empty
#1386, by timing old script: 1 orphan in 1,900 timed runs 0 in 1,500
#1386, TERM during a kubectl call without the first-line trap: the call is not waited for 6 calls of a run and 1 of --preflight: call waited for, no further call, exit 143
#1387 old run.sh under fake kubectl and helm: no saver armed, run directory without report saver armed before the abort; report and stream in the run directory, byte for byte; the gate grades them
refused field old gate on the real f0750ec report: engines called LOST BACKEND; with errors reworded: nothing recognised REFUSED AT THE EXECUTION CAP … [refused by: …], lost_backends=0
lost backend beside a refusal a gate that treats every entry as a refusal hides it named LOST BACKEND, lost_backends=1

Mutation checks: nine single-line mutations of the new logic (the two traps, the fork-free wait, three in the gate, the fallback, two in run.sh); each turns the test red.

New fixtures are real kind reports against f0750ec, cut down but not edited: kind-refused.* (the staircase: report, results stream, pod log) and kind-capped.* (eight targets against engines capped at 4). The two canned variations (reworded errors, one entry unmarked) are made from them inside the test.

Measured on kind against f0750ec (run directories in ~/aether-soak-logs/1008-sortie-f0750ec-kind/), all through run.sh e2e --verify:

  • 5 minutes clean: 43,200 of 43,200, gate PASS.
  • Engines capped below the plan: the Job failed at once; run.sh had armed the saver, and aborted 45 s later with SORTIE_SAVED … executions=8 … stream_executions=8.
  • The driver's node frozen from T+46 s to T+300 s, and again for ten minutes (the case that showed the defect with 9fcbb81): the healthy node's waiting results were taken on 16 of 16 executions; only the frozen node's own engine failed. With 9fcbb81, four of eight were reported silent.
  • On the wire, one counter across two runs: 40|c 45|c … 44|c 5|c (the report's 540), then 40|c 45|c … again under the same name. Deltas.

Measured on talos-main, read-only (Prometheus): one statsd series read 7,739 after run 4, started from zero for the soak 21 minutes later, and read 241,808 at the soak's end where the report has 275,400, with one reset inside the run; increase() over the window read 274,864.

Checks run: bazel test //scripts/... //e2e/... //bazel/actionlint:all, the lint build with fail_on_violation, make format-check, scripts/check-shell-lint.sh, scripts/check-registry-config.sh.

Inferred, not measured

  • Why the old trap's kill sometimes missed the sleep (the second moment above). I saw the sleep survive a kill that was sent; that the child was still a copy of the shell with its TERM handler is my explanation.
  • That run 4's 19 short requests come from one engine starting 0.3 s late. The timestamps and that engine's shorter elapsed time agree; why it started late is unknown.

Not verified

  • f0750ec has not run on talos-main. Nothing was written to that cluster.
  • The prober figures of the soak (liveness 0 non-success; mesh_dns 37 timeouts, all node="main-worker-04") are as reported to me; a read-only increase() over T0..T0+8h agrees. The proposal says the attribution is under investigation and no more.
  • A backend that answers within the ten seconds after a missed deadline: both frozen-driver runs had the answer already waiting.
  • Runs 3 and 4 and the soak have no access-log cross-check and no engine CPU reading in their run directories; the proposal lists both as open.
  • Paths that only run on main: none. The soak itself only runs from a workstation.

One thing found on the way

bash 5.2.21 can lose a trapped signal that arrives while it is expanding a $(…): it prints trap: line 2: unexpected EOF while looking for matching ')', does not run the handler, and the script carries on. Seen 2 times in 1,680 timed TERMs, both in the $(date …) of the watchdog's log line. It orphans nothing, and the watchdog spends nearly all its time in a wait where it cannot happen, so this PR does not work around it; the test delivers its in-command TERMs from the fake kubectl instead of from a timer, which avoids it. Noted in the proposal's open questions.

The test now has timeout = "moderate": it takes 14–22 s here, most of it the 134 short watchdog runs, and I did not want it near the 60 s default on a slower runner.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Copilot AI balanced review requested due to automatic review settings October 8, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Saver startup timing contradicts the stated guarantee, and failed saves can be misreported as successful.

2 open findings
What changed in this PR

Improves the soak harness’s shutdown and failure capture behavior while upgrading sortie to f0750ec.

Changes:

  • Replaces watchdog child sleeps with interruptible FIFO waits.
  • Saves immediately failed sortie Jobs and recognizes structured execution-cap refusals.
  • Updates sortie pins, fixtures, tests, and operational documentation.
File Description
e2e/​soak/​restart-watch.sh Adds orphan-free waits and signal handling.
e2e/​soak/​run.sh Starts the saver before handling terminal pod phases.
e2e/​soak/​sortie-gate.sh Classifies structured refusals separately from lost backends.
e2e/​soak/​sortie-values.yaml Updates sortie image pins.
e2e/​soak/​harness_test.sh Expands watchdog, saver, and gate tests.
e2e/​soak/​BUILD.bazel Adjusts the harness test timeout.
e2e/​soak/​README.md Updates operating and telemetry guidance.
docs/​proposals/​042_sortie-soak-driver.md Records new evidence and risks.
e2e/​soak/​testdata/​sortie/​kind-refused.shares.tsv Adds refusal share data.
e2e/​soak/​testdata/​sortie/​kind-refused.log Adds a refusal log fixture.
e2e/​soak/​testdata/​sortie/​kind-refused.json Adds a refusal report fixture.
e2e/​soak/​testdata/​sortie/​kind-refused.engines.tsv Adds refusal engine mappings.
e2e/​soak/​testdata/​sortie/​kind-refused-stream.jsonl Adds refusal stream data.
e2e/​soak/​testdata/​sortie/​kind-capped.targets.txt Adds capped-run targets.
e2e/​soak/​testdata/​sortie/​kind-capped.json Adds an immediate-failure report.
e2e/​soak/​testdata/​sortie/​kind-capped-stream.jsonl Adds its execution stream.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread e2e/soak/run.sh Resolved
Comment thread e2e/soak/run.sh Resolved
…still saved, and the harness moves to sortie f0750ec (#1386, #1387, #1388)

restart-watch.sh (#1386). The wait between samples was `sleep N &`,
`SLEEP_PID=$!`, `wait`, with a trap that killed $SLEEP_PID. A TERM between
the first two commands found the variable empty and left the sleep behind;
a TERM just after them sent its kill and sometimes left it behind as well.
The wait now has no child process: `read -t` on a private fifo, in slices
of two seconds. TERM and INT are trapped from the script's first line, so a
kubectl call in the foreground is waited for instead of orphaned.

run.sh (#1387). The saver is armed as soon as the Job exists, before the
first look at its pod. A Job that has already ended still aborts the
kickoff, but the abort waits for the saver and says where the report is.

sortie f0750ec. Chart, driver and engine pinned by the digests the registry
serves for that commit, each verified with the pinned cosign. The engine's
layers are those of 9fcbb81; its digest is new because the commit is a
label in the image config. sortie-gate.sh knows a stage refused at the
execution cap by sortie's new `refused` field, tells a lost backend from a
refusing one inside such a stage, and reads the error text only for a
report without the field (sortie 9fcbb81, whose reports are still graded).

Docs. The README and proposal 042 say that a statsd total is never one
run's count (the engine sends deltas; talos-main's Prometheus showed a
series at 241,808 where the report has 275,400). Proposal 042 records
talos-main runs 3 and 4 and the first 8-hour soak (#1388), and the kind
runs made against f0750ec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Copilot AI balanced review requested due to automatic review settings October 8, 2026 12:27
@bpalermo
bpalermo force-pushed the fix/soak-watchdog-saver-sortie-f0750ec branch from 351f195 to 7fe20cf Compare October 8, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Signal handling, detached process lifecycle, and external artifact changes warrant final human validation.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants