Merge remote-tracking branch 'origin/main' into billing-usage
20 files changed,
+602
−22
approved_copy_zdd_test.go+3 −2approved_rootfs_copy_test.go+5 −0docs/superpowers/notes/census-proposal-rootfs-worker-exit.md+26 −0docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json+1 −0docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md+4 −3docs/superpowers/reviews/CODEX-FINDINGS-rootfs-worker-exit-R1.md+32 −0docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-worker-exit.md+28 −0instances_cli.go+4 −1instances_rollout_test.go+5 −0internal/activator/backend_exec.go+4 −0internal/activator/control.go+38 −0internal/activator/rootfsworkers.go+13 −4internal/activator/rootfsworkers_backend_test.go+223 −1internal/activator/rootfsworkers_test.go+85 −4internal/activator/unitproc.go+101 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv+14 −0internal/rolloutwords/words.go+9 −4internal/rolloutwords/words_test.go+3 −1plan3_groups_test.go+3 −2
diff --git a/approved_copy_zdd_test.go b/approved_copy_zdd_test.go| index e0900c5cb..9ae142287 100644 |
| --- a/approved_copy_zdd_test.go |
| +++ b/approved_copy_zdd_test.go |
| @@ -6,7 +6,8 @@ import ( |
| ) |
| // zddCopyIDs is the zero-downtime plan 6 copy inventory, pinned as a literal: |
| -// the 149 strings Paul approved on 2026-10-11. The record must name every one, |
| +// the 149 strings Paul approved on 2026-10-11, and zdd.state.held-because, |
| +// approved on 2026-10-30 (its entry says so). The record must name every one, |
| // once, and nothing else. A record that loses an entry fails here even though |
| // every entry left in it is applied. |
| var zddCopyIDs = []string{ |
| @@ -32,7 +33,7 @@ var zddCopyIDs = []string{ |
| "zdd.ship.bad-swap", "zdd.ship.hold-note", "zdd.ship.no-echo", "zdd.deploy.usage-flag", |
| "zdd.deploy.held-until", "zdd.instances-retry.usage-line", "zdd.instances-retry.usage-para", |
| "zdd.instances-retry.done", "zdd.instances-retry.old-console", "zdd.list.header", |
| - "zdd.list.retry-hint", "zdd.state.held", "zdd.state.rolling-out", "zdd.state.asleep", |
| + "zdd.list.retry-hint", "zdd.state.held", "zdd.state.held-because", "zdd.state.rolling-out", "zdd.state.asleep", |
| "zdd.state.config-pending", "zdd.cause.release", "zdd.cause.install", "zdd.cause.retry", |
| "zdd.cause.restart", "zdd.cause.config", "zdd.reason.health", "zdd.reason.settle", |
| "zdd.reason.exit", "zdd.reason.staging", "zdd.reason.reused", "zdd.reason.unknown", |
diff --git a/approved_rootfs_copy_test.go b/approved_rootfs_copy_test.go| index 08ef60b2e..72743dd3e 100644 |
| --- a/approved_rootfs_copy_test.go |
| +++ b/approved_rootfs_copy_test.go |
| @@ -68,6 +68,8 @@ var rootfsCopyIDs = []string{ |
| "RFS-3-C25", "RFS-3-C26", "RFS-3-C27", "RFS-3-C28", |
| "RFS-3-C29", "RFS-3-C30", "RFS-3-C31", "RFS-3-C32", |
| "RFS-3-C33", "RFS-3-C34", |
| + // Task 11 end-to-end (approved 2026-10-30): a worker exit with no status |
| + "RFS-3-C35", |
| // Plan 4 |
| "RFS-4-C01", "RFS-4-C02", "RFS-4-C03", "RFS-4-C04", |
| "RFS-4-C05", "RFS-4-C06", "RFS-4-C07", "RFS-4-C08", |
| @@ -211,6 +213,9 @@ var rootfsCopyBuilt = []string{ |
| // Plan 3 Group W, W1b: the worker events |
| // (internal/rolloutwords/words.go) |
| "RFS-3-C08", "RFS-3-C09", "RFS-3-C10", |
| + // Task 11 end-to-end: a worker exit with no status to tell |
| + // (internal/rolloutwords/words.go) |
| + "RFS-3-C35", |
| // Plan 4 Task 2: what the creating release says, and where a rootfs row |
| // may run (internal/console/rootfs.go) |
| "RFS-4-C01", "RFS-4-C02", "RFS-4-C05", "RFS-4-C06", "RFS-4-C07", "RFS-4-C08", |
diff --git a/docs/superpowers/notes/census-proposal-rootfs-worker-exit.md b/docs/superpowers/notes/census-proposal-rootfs-worker-exit.md| new file mode 100644 |
| index 000000000..4232ec797 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-rootfs-worker-exit.md |
| @@ -0,0 +1,26 @@ |
| +# Census approval: rootfs-worker-exit |
| + |
| +Ruling `census-ruling-rootfs-worker-exit`. The independent reviewer approves or rejects every change below, 2 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/activator/unitproc.go` `ExecBackend.observe` | body | unchanged (22) | an exit record with an empty code (read and bounded as before) is filled by unitMainExitOf before it is kept for a worker or worded for the member; the termination proof (UnitState, cgroup evidence, the foreign-invocation rule) and the record's single-use removal are unchanged; the same 22 read sites, no read added | |
| +| `internal/activator/rootfsworkers.go` `Service.noteWorkerExitLocked` | sites | +whole:Route | a worker that ended with no status to tell now also emits the member event RFS-3-C35 at warn (a failed start, which never ran, still gets the operator line alone, platform-39) (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent | |
| + |
| +Envelopes re-pinned: `.`, `internal/activator`, `internal/rolloutwords`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/activator/unitproc.go` `ExecBackend.observe`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=final fix I3: the process observer's termination proof for a rootfs handle (Runtime, the new kind, one site) goes through unitEvents (two more Route sites): the host slice's cgroup.events and, for a rootfs unit, the group systemd reports when that is elsewhere, so a foreign invocation root placed outside the slice and could not stop is never read as gone from the absent expected path; a failed stop of a foreign invocation leaves it unstopped, asked again next poll, completion pending; a binary handle's proof is unchanged (cgroup.events under the host slice); the agent decides only whether it keeps a handle and a launch file; no root decision; re-digested at the merge of origin/main 3c33f2eb: main's own change to the observer is in the body, this branch's rootfs-aware evidence and the rootfs-only failed-stop retry (merge prep N1: a binary handle behaves exactly as main) on top; the kinds are the union;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: for a worker handle (p.worker != "") the observer keeps the exit record it read (workerExit, workerExitOK) for the supervisor instead of wording a member event, and says nothing for a replaced-after-stop or restarted-outside end; the termination evidence (cgroup.events via unitEvents, the foreign-invocation rule) and the record's single-use removal are unchanged and apply to a worker as to a generation; a binary or generation handle behaves exactly as before; the same 22 read sites, no read added |
| +- `internal/activator/rootfsworkers.go` `Service.noteWorkerExitLocked`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.16: the backoff, restart count and member event of one worker exit (RFS-3-C09 and RFS-3-C10); in-memory and the member's journal only |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `internal/activator/control.go:systemctlUnitMainExit`: reads +file:CommandContext; written legacy, accepted-legacy, frozen |
| +- new `internal/activator/unitproc.go:ExecBackend.unitMainExitOf`: reads +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen |
| + |
| +Seal: `78b7e7e30ad3ada44388a4ee16f3950ef888ae03e552477dcbfbb07c51ffb83e` → `7ebc3871ee3c93ff168bfa62d23d6be5a970786c67a9b8aa813e8cc4e39b3d74`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json b/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json| index b7d256255..1b14fb26f 100644 |
| --- a/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json |
| +++ b/docs/superpowers/plans/2026-10-07-zero-downtime-deploys-6-copy.json |
| @@ -76,6 +76,7 @@ |
| {"id": "zdd.list.header", "file": "instances_cli.go", "text": "HOST\\tREGION\\tCHANNEL\\tPOOL\\tINSTALLED\\tSERVING\\tHEALTH\\tUPSTREAMS\\tDB\\tEGRESS\\tCREATED\\tBY\\tREASON"}, |
| {"id": "zdd.list.retry-hint", "file": "instances_cli.go", "text": "a build that failed is tried again on every box with carlos promote --app %s --retry <version> <channel>, or on one instance with carlos instances retry --app %s <host>"}, |
| {"id": "zdd.state.held", "file": "internal/rolloutwords/words.go", "text": "held: build %s failed on this box"}, |
| + {"id": "zdd.state.held-because", "file": "internal/rolloutwords/words.go", "text": "held: build %s failed on this box, because %s", "approved_on": "2026-10-30"}, |
| {"id": "zdd.state.rolling-out", "file": "internal/rolloutwords/words.go", "text": "rolling out"}, |
| {"id": "zdd.state.asleep", "file": "internal/rolloutwords/words.go", "text": "starts %s on its next request"}, |
| {"id": "zdd.state.config-pending", "file": "internal/rolloutwords/words.go", "text": "config delivered, not active"}, |
diff --git a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md| index ec3bf165d..d0509ce81 100644 |
| --- a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md |
| +++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md |
| @@ -202,8 +202,9 @@ From the plan: Every row goes to the deck in Task 1 and reaches code only once a |
| | RFS-3-C32 | internal/release/layoutintent.go (RootfsFloorOverrideUsage, the --allow-below-rootfs-floor help on carlos system update, rollback and apply) | allow a release below v0.29.0 where v0.29.0 or later runs now. boxes may have rootfs instances that release cannot run | approved | |
| | RFS-3-C33 | internal/host/systemapply.go (systemApplyRootfsFloorRefusal, a hand-run carlos system apply refused on a box on the rootfs floor: the installed release, the floor, the candidate) | this box runs %s, so carlos system apply installs only %s or later here, the releases that run rootfs instances. %s is not one. to install it anyway, pass --allow-below-rootfs-floor | approved | |
| | RFS-3-C34 | internal/host/systemapply.go (systemApplyRootfsFloorOverride, the hand-run apply's log warning when the override lets a release below the floor through: the candidate, the floor, the candidate) | installing %s below %s with --allow-below-rootfs-floor: this box may have rootfs instances that %s cannot run | approved | |
| +| RFS-3-C35 | internal/rolloutwords/words.go (EventWorkerExitedUnknown, RFS-3-C09 for a worker exit with no status to tell: the worker, the delay; approved by Paul 2026-10-30 after the Task 11 end-to-end run) | worker %s exited. starting it again in %s | approved | |
| -From the plan: Count: 29 rows, 28 live, 1 struck (RFS-3-C13). Since then (Task 15 rounds 3 and 4, 2026-10-26/27): 34 rows, 32 live, 2 struck (RFS-3-C13, RFS-3-C25); RFS-3-C30 to C34 were approved by Paul in the copy pass of 2026-10-27, which also revised RFS-4-C01, C05 and C06. The floor moved to the console in round 4, so C30 and C31 are the console's and C33 and C34 the hand-run apply's. (RFS-3-C28 is live until Plan 6 Task 16 marks it struck when runs reach fleet boxes, R7.) |
| +From the plan: Count: 29 rows, 28 live, 1 struck (RFS-3-C13). Since then (Task 15 rounds 3 and 4, 2026-10-26/27): 34 rows, 32 live, 2 struck (RFS-3-C13, RFS-3-C25); RFS-3-C30 to C34 were approved by Paul in the copy pass of 2026-10-27, which also revised RFS-4-C01, C05 and C06. The floor moved to the console in round 4, so C30 and C31 are the console's and C33 and C34 the hand-run apply's. (RFS-3-C28 is live until Plan 6 Task 16 marks it struck when runs reach fleet boxes, R7.) RFS-3-C35 was approved by Paul on 2026-10-30, after the Task 11 end-to-end run: the member's line for a worker exit with no status to tell, where only an operator line was written before. 35 rows, 33 live, 2 struck. |
| Plan 3's file cells were set on 2026-10-26 (Plan 3 pre-flight, row 8.3) to the one file that holds each literal, with the old where-it-appears text kept as the note, so the gate's applied-text check can read them. C05 to C07 also format through `ReleaseError.Error`, named in the note. RFS-3-C13 was struck the same day (pre-flight row 3.1): host lifecycle claims are shelved, and Plan 3 adds no reader of the claim switch. The texts are unchanged. |
| @@ -561,8 +562,8 @@ strike them (Astra R2 finding 5). |
| - Plan 1: 85 live, 0 struck, 85 rows |
| - Plan 2: 12 live, 0 struck, 12 rows |
| -- Plan 3: 32 live, 2 struck, 34 rows |
| +- Plan 3: 33 live, 2 struck, 35 rows |
| - Plan 4: 138 live, 0 struck, 138 rows |
| - Plan 5: 44 live, 0 struck, 44 rows |
| - Plan 6: 64 live, 0 struck, 64 rows |
| -- Total: 375 live, 2 struck, 377 rows |
| +- Total: 376 live, 2 struck, 378 rows |
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-worker-exit-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-worker-exit-R1.md| new file mode 100644 |
| index 000000000..b0fb9facb |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-worker-exit-R1.md |
| @@ -0,0 +1,32 @@ |
| +Reviewed `a66482c9..18e55618` at pinned tip `8ea0b282a8c046e1687f3f326f9b90f5052794b3`, round 1/3. |
| + |
| +**P1:** None. |
| + |
| +**P2 — The fallback misclassifies accepted clean exits as failures.** |
| +Evidence: [unitproc.go:547](internal/activator/unitproc.go:547) treats only exit `0` as success, then overwrites the record’s `"success"` result at [unitproc.go:565](internal/activator/unitproc.go:565). The templates explicitly accept `129`, `130`, `141`, and `143`; [the rootfs generation template:40](internal/host/units/carlos-instance-rootfs-gen@.service:40) explains why. |
| + |
| +Failure scenario: a normal SIGTERM stop leaves an empty-code record and matching main status `1/143`. The fallback changes its result to `"exit-code"`, causing `exitLine`/`exitLevel` to report a warning. Systemd also treats certain signal deaths as clean. [Systemd’s classification](https://raw.githubusercontent.com/systemd/systemd/v257/src/shared/exit-status.c) confirms that nonzero status alone does not establish failure. |
| + |
| +Fix: apply the relevant unit’s clean-exit policy when reconstructing the result. Preserve the `137` failure correction. Add regression cases for accepted nonzero exits and clean signals; the new test currently checks only `0` as clean at [rootfsworkers_backend_test.go:659](internal/activator/rootfsworkers_backend_test.go:659). |
| + |
| +Invariant: reconstructing missing exit fields must preserve the unit’s successful-stop semantics. Termination proof, restart eligibility and lease handling are unaffected. |
| + |
| +**P3:** None. |
| + |
| +**Census verdicts — authority and read-boundary review** |
| + |
| +| Unit or envelope | Verdict | Evidence and basis | |
| +|---|---|---| |
| +| `ExecBackend.observe` | APPROVE | [unitproc.go:451](internal/activator/unitproc.go:451): termination evidence remains required before consuming the advisory record. | |
| +| `Service.noteWorkerExitLocked` | APPROVE | [rootfsworkers.go:622](internal/activator/rootfsworkers.go:622): changes event reporting only; failed starts remain excluded and C35 uses C09 pacing. | |
| +| `systemctlUnitMainExit` | APPROVE | [control.go:127](internal/activator/control.go:127): unprivileged query of the handle’s generated unit name; no new root operation. | |
| +| `ExecBackend.unitMainExitOf` | APPROVE | [unitproc.go:515](internal/activator/unitproc.go:515): bounded query, matching nonempty invocation required, advisory fields only. | |
| +| `.` envelope | APPROVE | [instances_cli.go:596](instances_cli.go:596): REASON uses `rolloutwords.Reason`; empty reason retains the existing cell. | |
| +| `internal/activator` envelope | APPROVE | New seam, mapping and event path introduce no additional root authority or weaker termination check. The P2 above concerns reporting. | |
| +| `internal/rolloutwords` envelope | APPROVE | [words.go:109](internal/rolloutwords/words.go:109): approved format constants only. | |
| + |
| +The invocation and main-exit fields come from one systemd property snapshot; a replacement invocation is rejected. Systemd resets main-exit status when starting a new invocation. [Query implementation](https://raw.githubusercontent.com/systemd/systemd/v257/src/shared/bus-map-properties.c), [service lifecycle](https://raw.githubusercontent.com/systemd/systemd/v257/src/core/service.c). |
| + |
| +`git diff --check` passed. Targeted tests could not start: the read-only sandbox denied Go’s build directory under `$TMPDIR`. `GOCACHE` remained unset. No full suites ran, and mutation results were not verified. No files were edited. |
| + |
| +READY AFTER FIXES |
| \ No newline at end of file |
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-worker-exit.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-worker-exit.md| new file mode 100644 |
| index 000000000..94b7a35eb |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-worker-exit.md |
| @@ -0,0 +1,28 @@ |
| +# Review brief: rootfs-worker-exit, round 1 of 3 |
| + |
| +Repo carlos/platform, branch `rootfs-worker-exit`, review the diff `a66482c9..<this brief's parent>`. |
| +Authorities on main: docs/superpowers/specs/2026-10-24-rootfs-apps-design.md (§5.4 crashes and restarts), docs/superpowers/plans/2026-10-24-rootfs-apps-3-lifecycle.md (Group W: RFS-3-C08..C10, "every other exit emits C09"), AGENTS.md (census, copy, stopping rules). |
| + |
| +You are an independent reviewer. Read the diff, then the code it names, and check every claim against that code. |
| + |
| +## The changes (found by Task 11 on dev fleet box r10r, systemd 257 with PrivatePIDs) |
| +1. 60edee13: a SIGKILLed rootfs process's exit record held result "success" with empty code/status, because systemd kills a not-our-child main pid before recording its exit, so ExecStopPost gets no EXIT_CODE/EXIT_STATUS. observe (internal/activator/unitproc.go) now falls back to systemd's ExecMainCode/ExecMainStatus through a new seam UnitMainExit (systemctl show), only when systemd's InvocationID matches the handle's; 1 -> exited/status, 2 -> killed, 3 -> dumped (signal named via workerSignals); a "success" result over a non-zero main exit becomes systemd's word. Covers run, gen, worker and sidecar handles; release cmd status already comes from root's cmdStatusOf. |
| +2. 8ea8e816 + 18e55618: a worker that ran and ended with no status emits RFS-3-C35 "worker %s exited. starting it again in %s" (Paul approved the text unchanged; id C12 was taken) at warn, paced like C09; a failed start keeps its old behaviour (log line, C10 on loop entry). |
| +3. b505b547: instances list REASON prints zdd.state.held-because "held: build %s failed on this box, because %s" with rolloutwords.Reason(r.Reason) when the box sent a reason, else zdd.state.held (Paul approved the text unchanged). |
| +4. census: card docs/superpowers/notes/census-proposal-rootfs-worker-exit.md. |
| + |
| +## What to check |
| +1. The fallback's trust: can a stale or foreign systemd state (a newer invocation, another instance's unit, a restarted unit) be attributed to this handle? Is the InvocationID match sufficient and race-free? What happens when systemctl fails or prints words instead of numbers? |
| +2. Mapping correctness against systemd's ExecMainCode values and the existing exit-status consumers (crash loop, C09/C11 wording, worker restarts, web generation stop/swap logic, lease proof). Could the "success over non-zero" rewrite change a clean stop into a crash, or the reverse, anywhere? |
| +3. RFS-3-C35 pacing and level; failed starts excluded; nothing else changes for workers that have a status. |
| +4. REASON: only rolloutwords.Reason phrases reach the cell (no raw box text); empty reason keeps the old cell. |
| +5. Census verdict for every unit and envelope on the card per AGENTS.md "Getting a change approved". |
| +6. Tests and mutations pin 1-4. |
| + |
| +## Severity |
| +P1 unsafe/wrong/fails, blocks merge; P2 wrong or missing, fixed without another round; P3 polish, follow-up list. |
| + |
| +## Output |
| +Findings P1, P2, P3 with evidence (file:line), failure scenario, fix, invariant. Census verdicts. End with exactly one verdict: READY, READY AFTER FIXES, or NOT READY. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites. |
diff --git a/instances_cli.go b/instances_cli.go| index 3f5ea5d8b..b3dc1f117 100644 |
| --- a/instances_cli.go |
| +++ b/instances_cli.go |
| @@ -588,7 +588,8 @@ func servingCell(r apiInstanceRecord) string { |
| } |
| // rolloutReason is the REASON cell (spec §9.1): why the serving build is not |
| -// the installed one, or that new config waits for a process (§8.1). A box that |
| +// the installed one, or that new config waits for a process (§8.1). A held |
| +// build says why it failed when the box reports a reason word. A box that |
| // cannot arm its scheduler says why first: its other fields are meaningless. |
| // An asleep instance serves nothing (plan 5 reports Serving "" for it), so its |
| // installed build is compared with Good, the build it last ran. |
| @@ -598,6 +599,8 @@ func rolloutReason(r *apiRollout) string { |
| return "" |
| case r.Unavailable != "": |
| return rolloutwords.Unavailable(r.Unavailable) |
| + case r.HeldBy != "" && r.Reason != "": |
| + return fmt.Sprintf(rolloutwords.StateHeldBecause, r.HeldBy, rolloutwords.Reason(r.Reason)) |
| case r.HeldBy != "": |
| return fmt.Sprintf(rolloutwords.StateHeld, r.HeldBy) |
| case !r.Awake && r.Installed != r.Good: |
diff --git a/instances_rollout_test.go b/instances_rollout_test.go| index d444f554a..5fabcb2c1 100644 |
| --- a/instances_rollout_test.go |
| +++ b/instances_rollout_test.go |
| @@ -44,6 +44,11 @@ func TestRolloutReason(t *testing.T) { |
| // Plan 5 reports no serving build for an asleep instance: its last |
| // good build is what it ran. |
| {&apiRollout{Installed: "v2", Good: "v1", HeldBy: "v2"}, fmt.Sprintf(rolloutwords.StateHeld, "v2")}, |
| + // The box says why the build failed (rolloutwords.Reason, read after |
| + // "because"); a word this binary does not know still reads. |
| + {&apiRollout{Installed: "v2", Serving: "v1", Awake: true, HeldBy: "v2", Reason: "release"}, "held: build v2 failed on this box, because its release command failed"}, |
| + {&apiRollout{Installed: "v2", Good: "v1", HeldBy: "v2", Reason: "health"}, fmt.Sprintf(rolloutwords.StateHeldBecause, "v2", rolloutwords.Reason("health"))}, |
| + {&apiRollout{Installed: "v2", Serving: "v1", Awake: true, HeldBy: "v2", Reason: "newer-word"}, fmt.Sprintf(rolloutwords.StateHeldBecause, "v2", rolloutwords.Reason("newer-word"))}, |
| {&apiRollout{Installed: "v2", Good: "v1"}, fmt.Sprintf(rolloutwords.StateAsleep, "v2")}, |
| {&apiRollout{Installed: "v2", Good: "v2"}, ""}, |
| {&apiRollout{Installed: "v2", Serving: "v1", Awake: true}, rolloutwords.StateRollingOut}, |
diff --git a/internal/activator/backend_exec.go b/internal/activator/backend_exec.go| index 3c75bd141..3bde4f030 100644 |
| --- a/internal/activator/backend_exec.go |
| +++ b/internal/activator/backend_exec.go |
| @@ -192,6 +192,10 @@ type ExecBackend struct { |
| // UnitState answers `systemctl show` for the observer (design §6.5). |
| // Nil: systemctlUnitState, the real systemctl binary. |
| UnitState UnitState |
| + // UnitMainExit answers how systemd recorded a unit's main process's |
| + // end, for an exit record that carries no code (unitMainExitOf). Nil: |
| + // systemctlUnitMainExit, the real systemctl binary. |
| + UnitMainExit UnitMainExit |
| // CgroupEvents reads a unit's cgroup.events for the observer and for a |
| // seed's cgroup-empty wait. Nil: cgroupEventsUnder("/sys/fs/cgroup"), |
| // or CgroupRoot when set. |
diff --git a/internal/activator/control.go b/internal/activator/control.go| index 9c6fadcb6..0ca06618b 100644 |
| --- a/internal/activator/control.go |
| +++ b/internal/activator/control.go |
| @@ -116,6 +116,44 @@ func systemctlUnitState(ctx context.Context, unit string) (string, string, error |
| return active, inv, nil |
| } |
| +// UnitMainExit answers `systemctl show -p |
| +// InvocationID,ExecMainCode,ExecMainStatus,SuccessExitStatus <unit>`, which |
| +// needs no privilege: how systemd recorded the end of the unit's main |
| +// process, the invocation it belongs to, and the unit's own clean-exit |
| +// policy as systemd loaded it from the template the platform ships. |
| +type UnitMainExit func(ctx context.Context, unit string) (MainExit, error) |
| + |
| +// MainExit is one `systemctl show` of a unit's main process's end. Code is |
| +// a number (0 none recorded, 1 exited, 2 killed, 3 dumped), Status the exit |
| +// code or the signal's number, SuccessExitStatus the unit's |
| +// SuccessExitStatus= as systemctl prints it: exit codes, then signal names. |
| +type MainExit struct { |
| + Invocation, Code, Status, SuccessExitStatus string |
| +} |
| + |
| +func systemctlUnitMainExit(ctx context.Context, unit string) (MainExit, error) { |
| + out, err := exec.CommandContext(ctx, "systemctl", "show", "-p", "InvocationID,ExecMainCode,ExecMainStatus,SuccessExitStatus", unit).Output() |
| + if err != nil { |
| + return MainExit{}, err |
| + } |
| + var m MainExit |
| + for _, line := range strings.Split(string(out), "\n") { |
| + if k, v, ok := strings.Cut(line, "="); ok { |
| + switch v = strings.TrimSpace(v); k { |
| + case "InvocationID": |
| + m.Invocation = v |
| + case "ExecMainCode": |
| + m.Code = v |
| + case "ExecMainStatus": |
| + m.Status = v |
| + case "SuccessExitStatus": |
| + m.SuccessExitStatus = v |
| + } |
| + } |
| + } |
| + return m, nil |
| +} |
| + |
| // CgroupEvents reads the unit's cgroup.events under the host slice. cgroup |
| // v2 files are world-readable, so the agent reads them as carlos, as the |
| // sampler does. An absent directory is the unit's cgroup already removed. |
diff --git a/internal/activator/rootfsworkers.go b/internal/activator/rootfsworkers.go| index ab8d12f1f..26172e682 100644 |
| --- a/internal/activator/rootfsworkers.go |
| +++ b/internal/activator/rootfsworkers.go |
| @@ -615,8 +615,10 @@ type workerReleaser interface { |
| // run of sidecarHealthyRun), the restart count, and the member's event: |
| // RFS-3-C10 once on entering the crash loop, RFS-3-C09 with the delay |
| // otherwise (at most once a minute in the loop). An exit with no status to |
| -// tell gives an operator line instead of C09 [pf W1.16]. The caller holds |
| -// a.mu. |
| +// tell [pf W1.16] gives an operator line, and for a worker that ended |
| +// RFS-3-C35 in C09's place, paced the same way (Task 11 end-to-end, #366); |
| +// a failed start never ran, so it gets the operator line alone |
| +// (platform-39). The caller holds a.mu. |
| func (a *Service) noteWorkerExitLocked(e *actEntry, wk *rootfsWorker, now time.Time) { |
| if !wk.started.IsZero() && now.Sub(wk.started) >= sidecarHealthyRun { |
| wk.backoff, wk.crashLoop = 0, false |
| @@ -637,12 +639,19 @@ func (a *Service) noteWorkerExitLocked(e *actEntry, wk *rootfsWorker, now time.T |
| status, ok = workerExitStatus(wk.proc) |
| } |
| wait := time.Duration(retryAfterSeconds(wk.backoff)) * time.Second |
| + if !ok && !entered { |
| + log.Printf("activator: %s: worker %s ended with no exit status to tell (a failed start, no exit record, or an unknown signal); starting it again in %s", e.host, wk.name, wait) |
| + } |
| switch { |
| case entered: |
| emitEvent(a.Logs, e.route, "error", fmt.Sprintf(rolloutwords.EventWorkerCrashLoop, wk.name)) |
| - case !ok: |
| - log.Printf("activator: %s: worker %s ended with no exit status to tell (a failed start, no exit record, or an unknown signal); starting it again in %s", e.host, wk.name, wait) |
| + case wk.startFailed: |
| + // A launch that never ran did not exit (platform-39): the |
| + // operator line alone, as before RFS-3-C35. |
| case wk.crashLoop && !wk.lastExitEvent.IsZero() && now.Sub(wk.lastExitEvent) < time.Minute: |
| + case !ok: |
| + wk.lastExitEvent = now |
| + emitEvent(a.Logs, e.route, "warn", fmt.Sprintf(rolloutwords.EventWorkerExitedUnknown, wk.name, wait.String())) |
| default: |
| wk.lastExitEvent = now |
| emitEvent(a.Logs, e.route, "warn", fmt.Sprintf(rolloutwords.EventWorkerExited, wk.name, status, wait.String())) |
diff --git a/internal/activator/rootfsworkers_backend_test.go b/internal/activator/rootfsworkers_backend_test.go| index daf7be644..78b639a02 100644 |
| --- a/internal/activator/rootfsworkers_backend_test.go |
| +++ b/internal/activator/rootfsworkers_backend_test.go |
| @@ -33,6 +33,9 @@ type workerUnits struct { |
| m map[string]workerUnitState |
| read []string // every unit whose cgroup was read |
| stopEmpties bool |
| + // main is a unit's ExecMainCode and ExecMainStatus, with the |
| + // invocation they belong to (setMain); a unit not set has none. |
| + main map[string][3]string |
| } |
| type workerUnitState struct { |
| @@ -60,6 +63,55 @@ func (u *workerUnits) state(_ context.Context, unit string) (string, string, err |
| return s.active, s.inv, nil |
| } |
| +// setMain sets what systemd holds of unit's main process: the invocation, |
| +// ExecMainCode and ExecMainStatus. |
| +func (u *workerUnits) setMain(unit, inv, code, status string) { |
| + u.mu.Lock() |
| + if u.main == nil { |
| + u.main = map[string][3]string{} |
| + } |
| + u.main[unit] = [3]string{inv, code, status} |
| + u.mu.Unlock() |
| +} |
| + |
| +// mainExit is the fake UnitMainExit: an unset unit answers as systemd |
| +// does for one that never ran, code and status 0. The clean-exit policy is |
| +// the one the unit's template ships (shippedSuccessExitStatus), as systemd |
| +// would load it. |
| +func (u *workerUnits) mainExit(_ context.Context, unit string) (MainExit, error) { |
| + policy, err := shippedSuccessExitStatus(unit) |
| + if err != nil { |
| + return MainExit{}, err |
| + } |
| + u.mu.Lock() |
| + defer u.mu.Unlock() |
| + m, ok := u.main[unit] |
| + if !ok { |
| + return MainExit{Code: "0", Status: "0", SuccessExitStatus: policy}, nil |
| + } |
| + return MainExit{Invocation: m[0], Code: m[1], Status: m[2], SuccessExitStatus: policy}, nil |
| +} |
| + |
| +// shippedSuccessExitStatus is the SuccessExitStatus= of the template unit |
| +// is an instance of, read from the unit files the platform ships |
| +// (internal/host/units); "" when the template declares none. |
| +func shippedSuccessExitStatus(unit string) (string, error) { |
| + at := strings.Index(unit, "@") |
| + if at < 0 { |
| + return "", fmt.Errorf("%s is not a template's instance", unit) |
| + } |
| + raw, err := os.ReadFile(filepath.Join("..", "host", "units", unit[:at+1]+".service")) |
| + if err != nil { |
| + return "", err |
| + } |
| + for _, line := range strings.Split(string(raw), "\n") { |
| + if v, ok := strings.CutPrefix(line, "SuccessExitStatus="); ok { |
| + return strings.TrimSpace(v), nil |
| + } |
| + } |
| + return "", nil |
| +} |
| + |
| func (u *workerUnits) events(_ string, unit string) (bool, bool, error) { |
| u.mu.Lock() |
| defer u.mu.Unlock() |
| @@ -96,7 +148,7 @@ func newWorkerBackend(t *testing.T) (*ExecBackend, *fakeControl, registry.Route, |
| b, ctl := newRootfsBackend(t) |
| b.GenContainment = true |
| units := newWorkerUnits() |
| - b.UnitState, b.CgroupEvents = units.state, units.events |
| + b.UnitState, b.CgroupEvents, b.UnitMainExit = units.state, units.events, units.mainExit |
| ctl.stopHook = units.stopped |
| return b, ctl, rootfsRoute(b), units |
| } |
| @@ -586,6 +638,176 @@ func TestRootfsWorkerExitIsSilentToMembers(t *testing.T) { |
| }) |
| } |
| +// Task 11 end-to-end (#366): on systemd 257 with PrivatePIDs a SIGKILLed |
| +// unit's ExecStopPost gets no EXIT_CODE or EXIT_STATUS, so its record says |
| +// "success" with no code, while systemd still holds the main process's |
| +// end (ExecMainCode=1, ExecMainStatus=137). An empty code is read from |
| +// systemd, for the same invocation only, for a worker and for web alike. |
| +func TestAnExitRecordWithNoCodeReadsSystemd(t *testing.T) { |
| + t.Parallel() |
| + noCode := instancectl.ExitRecord{Invocation: "inv1", Result: "success"} |
| + worker := func(t *testing.T, mainInv, code, status string) (instancectl.ExitRecord, bool) { |
| + t.Helper() |
| + b, ctl, rt, units := newWorkerBackend(t) |
| + sink := &rootfsSink{} |
| + b.Logs = sink |
| + web, g := startWorkerWeb(t, b, ctl, rt, units, "") |
| + unit := instancectl.WorkerUnitName(rt.Host, "jobs") |
| + units.set(unit, "active", "inv1", true) |
| + wp, err := b.LaunchRootfsWorker(context.Background(), rt, "jobs", g, web) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + up := wp.(*unitProc) |
| + raw, err := json.Marshal(noCode) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.WriteFile(filepath.Join(up.runDir, instancectl.WorkerExitRecordName("jobs", "inv1")), raw, 0o600); err != nil { |
| + t.Fatal(err) |
| + } |
| + units.setMain(unit, mainInv, code, status) |
| + units.set(unit, "inactive", "inv1", false) |
| + waitFor(t, "the worker to exit", wp.Exited) |
| + if msgs := sink.msgs(); len(msgs) != 0 { |
| + t.Errorf("a worker's exit told the member %q", msgs) |
| + } |
| + return up.WorkerExit() |
| + } |
| + for _, tc := range []struct { |
| + name, code, status string |
| + want instancectl.ExitRecord |
| + status137 bool |
| + }{ |
| + {"killed under PrivatePIDs: exited 137", "1", "137", instancectl.ExitRecord{Invocation: "inv1", Result: "exit-code", Code: "exited", Status: "137"}, true}, |
| + {"killed by KILL", "2", "9", instancectl.ExitRecord{Invocation: "inv1", Result: "signal", Code: "killed", Status: "KILL"}, true}, |
| + {"dumped by SEGV", "3", "11", instancectl.ExitRecord{Invocation: "inv1", Result: "core-dump", Code: "dumped", Status: "SEGV"}, false}, |
| + {"a clean exit stays a success", "1", "0", instancectl.ExitRecord{Invocation: "inv1", Result: "success", Code: "exited", Status: "0"}, false}, |
| + // Astra R1 P2: a stop's SIGTERM reaches the app through the |
| + // trampoline, which exits 143, a status the template counts clean. |
| + {"stopped by TERM through the trampoline: a success", "1", "143", instancectl.ExitRecord{Invocation: "inv1", Result: "success", Code: "exited", Status: "143"}, false}, |
| + {"killed by TERM: a success", "2", "15", instancectl.ExitRecord{Invocation: "inv1", Result: "success", Code: "killed", Status: "TERM"}, false}, |
| + {"no exit recorded", "0", "0", noCode, false}, |
| + } { |
| + t.Run(tc.name, func(t *testing.T) { |
| + t.Parallel() |
| + got, ok := worker(t, "inv1", tc.code, tc.status) |
| + if !ok || got != tc.want { |
| + t.Fatalf("WorkerExit = %+v, %v; want %+v", got, ok, tc.want) |
| + } |
| + p := &fakeWorkerProc{} |
| + p.exit(got.Code, got.Status) |
| + if n, ok := workerExitStatus(p); tc.status137 && (!ok || n != 137) { |
| + t.Errorf("workerExitStatus = %d, %v; want 137", n, ok) |
| + } |
| + }) |
| + } |
| + t.Run("another invocation's end is not ours", func(t *testing.T) { |
| + t.Parallel() |
| + got, ok := worker(t, "inv2", "1", "137") |
| + if !ok || got != noCode { |
| + t.Fatalf("WorkerExit = %+v, %v; want the record as written", got, ok) |
| + } |
| + }) |
| + for _, tc := range []struct{ status, line, level string }{ |
| + {"137", "instance exited: exit 137 (exit-code)", "warn"}, |
| + {"143", "instance exited (exit 0)", "info"}, |
| + } { |
| + t.Run("web exits "+tc.status, func(t *testing.T) { |
| + t.Parallel() |
| + webExit(t, noCode, tc.status, tc.line, tc.level) |
| + }) |
| + } |
| +} |
| + |
| +// webExit ends rootfs web generation 7 with rec as its record and systemd's |
| +// main exit 1/status, and checks the member's one line and its level. |
| +func webExit(t *testing.T, rec instancectl.ExitRecord, status, line, level string) { |
| + t.Helper() |
| + { |
| + b, ctl, rt, units := newWorkerBackend(t) |
| + sink := &rootfsSink{} |
| + b.Logs = sink |
| + web, _ := startWorkerWeb(t, b, ctl, rt, units, "") |
| + raw, err := json.Marshal(rec) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.WriteFile(filepath.Join(web.runDir, instancectl.GenExitRecordName(7, "inv1")), raw, 0o600); err != nil { |
| + t.Fatal(err) |
| + } |
| + unit := instancectl.RootfsGenUnitName(rt.Host, 7) |
| + units.setMain(unit, "inv1", "1", status) |
| + units.set(unit, "inactive", "inv1", false) |
| + waitFor(t, "web to exit", web.Exited) |
| + if msgs := sink.msgs(); !slices.Equal(msgs, []string{line}) { |
| + t.Errorf("web's exit %s told the member %q, want %q", status, msgs, line) |
| + } |
| + sink.mu.Lock() |
| + defer sink.mu.Unlock() |
| + if len(sink.events) == 1 && sink.events[0].level != level { |
| + t.Errorf("web's exit %s at %q, want %s", status, sink.events[0].level, level) |
| + } |
| + } |
| +} |
| + |
| +// Astra R1 P2: an end rebuilt from systemd keeps the unit's own clean-exit |
| +// policy, the SuccessExitStatus= of the template each record-reading unit |
| +// is an instance of, and systemd's clean signals for a main process (HUP, |
| +// INT, PIPE, TERM). SIGKILL's 137 and every other end stay failures. |
| +func TestMainExitKeepsEachUnitsCleanExits(t *testing.T) { |
| + const host = "shop.example.com" |
| + noCode := instancectl.ExitRecord{Invocation: "inv1", Result: "success"} |
| + units := map[string]string{ |
| + "run": instancectl.UnitName(instancectl.RoleRun, host), |
| + "generation": instancectl.GenUnitName(host, 7), |
| + "sidecar": instancectl.UnitName(instancectl.RoleSidecar, host), |
| + "rootfs run": instancectl.RootfsUnitName(instancectl.RoleRun, host), |
| + "rootfs gen": instancectl.RootfsGenUnitName(host, 7), |
| + "rootfs work": instancectl.WorkerUnitName(host, "jobs"), |
| + } |
| + for kind, unit := range units { |
| + policy, err := shippedSuccessExitStatus(unit) |
| + if err != nil { |
| + t.Fatalf("%s: %v", kind, err) |
| + } |
| + statuses := strings.Fields(policy) |
| + if len(statuses) == 0 { |
| + t.Fatalf("%s: %s's template declares no SuccessExitStatus=", kind, unit) |
| + } |
| + check := func(m MainExit, want instancectl.ExitRecord) { |
| + t.Helper() |
| + m.SuccessExitStatus = policy |
| + want.Invocation = "inv1" |
| + if got := withMainExit(noCode, m); got != want { |
| + t.Errorf("%s (%s) %s/%s = %+v, want %+v", kind, policy, m.Code, m.Status, got, want) |
| + } |
| + } |
| + for _, s := range statuses { |
| + check(MainExit{Code: "1", Status: s}, instancectl.ExitRecord{Result: "success", Code: "exited", Status: s}) |
| + } |
| + for name, n := range map[string]string{"HUP": "1", "INT": "2", "PIPE": "13", "TERM": "15"} { |
| + check(MainExit{Code: "2", Status: n}, instancectl.ExitRecord{Result: "success", Code: "killed", Status: name}) |
| + } |
| + check(MainExit{Code: "1", Status: "0"}, instancectl.ExitRecord{Result: "success", Code: "exited", Status: "0"}) |
| + check(MainExit{Code: "1", Status: "137"}, instancectl.ExitRecord{Result: "exit-code", Code: "exited", Status: "137"}) |
| + check(MainExit{Code: "1", Status: "1"}, instancectl.ExitRecord{Result: "exit-code", Code: "exited", Status: "1"}) |
| + check(MainExit{Code: "2", Status: "9"}, instancectl.ExitRecord{Result: "signal", Code: "killed", Status: "KILL"}) |
| + check(MainExit{Code: "3", Status: "15"}, instancectl.ExitRecord{Result: "core-dump", Code: "dumped", Status: "TERM"}) |
| + } |
| + // The policy is what makes a status clean: none declared, 143 fails; |
| + // a signal the policy names by name is clean. |
| + if got := withMainExit(noCode, MainExit{Code: "1", Status: "143"}); got.Result != "exit-code" { |
| + t.Errorf("143 with no policy = %+v, want exit-code", got) |
| + } |
| + if got := withMainExit(noCode, MainExit{Code: "2", Status: "14", SuccessExitStatus: "129 SIGALRM"}); got.Result != "success" { |
| + t.Errorf("ALRM named by the policy = %+v, want success", got) |
| + } |
| + if got := withMainExit(noCode, MainExit{Code: "2", Status: "14", SuccessExitStatus: "129 130"}); got.Result != "signal" { |
| + t.Errorf("ALRM not named by the policy = %+v, want signal", got) |
| + } |
| +} |
| + |
| func TestRootfsWorkerRefusalsStartNothing(t *testing.T) { |
| t.Parallel() |
| for _, tc := range []struct { |
diff --git a/internal/activator/rootfsworkers_test.go b/internal/activator/rootfsworkers_test.go| index b9bd07b98..4116ebf49 100644 |
| --- a/internal/activator/rootfsworkers_test.go |
| +++ b/internal/activator/rootfsworkers_test.go |
| @@ -587,8 +587,18 @@ func TestRootfsWorkersStartAfterWebHealthy(t *testing.T) { |
| } |
| // crashLoop makes jobs exit ten times with code and status and checks the |
| -// restarts' delays, web untouched, and the member's events. |
| +// restarts' delays, web untouched, and the member's events: RFS-3-C09 |
| +// naming want. |
| func crashLoop(t *testing.T, code, status string, want int) { |
| + t.Helper() |
| + crashLoopTelling(t, code, status, func(wait string) string { |
| + return fmt.Sprintf(rolloutwords.EventWorkerExited, "jobs", want, wait) |
| + }) |
| +} |
| + |
| +// crashLoopTelling is crashLoop with the member's exit line given: line |
| +// words one exit from its restart's delay. |
| +func crashLoopTelling(t *testing.T, code, status string, line func(wait string) string) { |
| t.Helper() |
| r := newWorkerRig(t, workerHost(), "jobs") |
| r.wake(t) |
| @@ -625,11 +635,11 @@ func crashLoop(t *testing.T, code, status string, want int) { |
| } |
| exited := r.sink.with("worker jobs exited") |
| if len(exited) != 9 { |
| - t.Fatalf("RFS-3-C09 emitted %d times, want 9 (every exit but the one that entered the loop): %+v", len(exited), exited) |
| + t.Fatalf("the exit line emitted %d times, want 9 (every exit but the one that entered the loop): %+v", len(exited), exited) |
| } |
| for i, wait := range []string{"2s", "4s", "8s", "16s", "32s", "1m0s", "1m0s", "1m0s", "1m0s"} { |
| - if w := fmt.Sprintf(rolloutwords.EventWorkerExited, "jobs", want, wait); exited[i].msg != w { |
| - t.Errorf("C09 %d = %q, want %q", i+1, exited[i].msg, w) |
| + if w := line(wait); exited[i].msg != w || exited[i].level != "warn" { |
| + t.Errorf("exit line %d = %q at %q, want %q at warn", i+1, exited[i].msg, exited[i].level, w) |
| } |
| } |
| loop := r.sink.with(fmt.Sprintf(rolloutwords.EventWorkerCrashLoop, "jobs"))[0].at |
| @@ -651,6 +661,77 @@ func TestRootfsWorkerCrashNeverStopsWeb(t *testing.T) { crashLoop(t, "exited", " |
| // Review Focus 3: a clean exit is a crash too: restarted, never parked. |
| func TestCleanExitingWorkerIsRestartedNotParked(t *testing.T) { crashLoop(t, "exited", "0", 0) } |
| +// Task 11 end-to-end (#366): an exit with no status to tell (no record, or |
| +// an unknown signal) still tells the member, with RFS-3-C35 in C09's place, |
| +// paced the same way. |
| +func TestWorkerExitWithNoStatusTellsTheMember(t *testing.T) { |
| + for _, c := range []struct{ code, status string }{{"", ""}, {"killed", "WINCH"}} { |
| + crashLoopTelling(t, c.code, c.status, func(wait string) string { |
| + return fmt.Sprintf(rolloutwords.EventWorkerExitedUnknown, "jobs", wait) |
| + }) |
| + } |
| +} |
| + |
| +// In the crash loop RFS-3-C35 is paced as C09 is: at most once a minute, |
| +// with the operator line kept for every exit. |
| +func TestWorkerExitWithNoStatusIsPacedInTheLoop(t *testing.T) { |
| + sink := &rootfsSink{} |
| + a := &Service{Logs: sink} |
| + e := &actEntry{host: "shop.example.com", route: rootfsGateRoute("shop.example.com")} |
| + now := time.Date(2026, 10, 30, 12, 0, 0, 0, time.UTC) |
| + for _, c := range []struct { |
| + since time.Duration |
| + tells bool |
| + }{{10 * time.Second, false}, {61 * time.Second, true}} { |
| + p := &fakeWorkerProc{} |
| + p.exit("", "") |
| + wk := &rootfsWorker{name: "jobs", proc: p, backoff: sidecarRestartMax, crashLoop: true, lastExitEvent: now.Add(-c.since)} |
| + n := len(sink.msgs()) |
| + a.mu.Lock() |
| + a.noteWorkerExitLocked(e, wk, now) |
| + a.mu.Unlock() |
| + want := fmt.Sprintf(rolloutwords.EventWorkerExitedUnknown, "jobs", "1m0s") |
| + if got := sink.msgs()[n:]; c.tells != slices.Equal(got, []string{want}) || (!c.tells && len(got) != 0) { |
| + t.Errorf("%s after the last exit line: told %q, want it told %v", c.since, got, c.tells) |
| + } |
| + } |
| +} |
| + |
| +// A launch that never ran did not exit (platform-39): a failed start tells |
| +// the member nothing outside the crash loop's C10, as before RFS-3-C35, |
| +// while an ended worker with no status gets C35. |
| +func TestAFailedWorkerStartIsNoExitToTheMember(t *testing.T) { |
| + sink := &rootfsSink{} |
| + a := &Service{Logs: sink} |
| + e := &actEntry{host: "shop.example.com", route: rootfsGateRoute("shop.example.com")} |
| + now := time.Date(2026, 10, 30, 12, 0, 0, 0, time.UTC) |
| + note := func(wk *rootfsWorker) []string { |
| + n := len(sink.msgs()) |
| + a.mu.Lock() |
| + a.noteWorkerExitLocked(e, wk, now) |
| + a.mu.Unlock() |
| + return sink.msgs()[n:] |
| + } |
| + failed := &rootfsWorker{name: "jobs", startFailed: true} |
| + if got := note(failed); len(got) != 0 { |
| + t.Errorf("a failed start told the member %q, want nothing", got) |
| + } |
| + if !failed.lastExitEvent.IsZero() { |
| + t.Error("a failed start paced the exit line") |
| + } |
| + // Into the crash loop, a failed start still tells C10 once. |
| + looping := &rootfsWorker{name: "jobs", startFailed: true, backoff: sidecarRestartMax / 2} |
| + if got := note(looping); !slices.Equal(got, []string{fmt.Sprintf(rolloutwords.EventWorkerCrashLoop, "jobs")}) { |
| + t.Errorf("a failed start entering the loop told %q, want C10", got) |
| + } |
| + p := &fakeWorkerProc{} |
| + p.exit("", "") |
| + ended := &rootfsWorker{name: "jobs", proc: p} |
| + if got := note(ended); !slices.Equal(got, []string{fmt.Sprintf(rolloutwords.EventWorkerExitedUnknown, "jobs", "2s")}) { |
| + t.Errorf("an ended worker with no record told %q, want C35", got) |
| + } |
| +} |
| + |
| // [pf W1.16] C09's status: an exit code, 128 plus a known signal's number; |
| // no record or an unknown signal tells none. |
| func TestRootfsWorkerExitStatus(t *testing.T) { |
diff --git a/internal/activator/unitproc.go b/internal/activator/unitproc.go| index a368938d7..1ce55bd80 100644 |
| --- a/internal/activator/unitproc.go |
| +++ b/internal/activator/unitproc.go |
| @@ -8,6 +8,8 @@ import ( |
| "log" |
| "os" |
| "path/filepath" |
| + "strconv" |
| + "strings" |
| "sync/atomic" |
| "time" |
| @@ -467,6 +469,9 @@ func (b *ExecBackend) observe(p *unitProc) { |
| if !exists || !populated { |
| if terminal { |
| rec, ok := p.readRecord() |
| + if ok && rec.Code == "" { |
| + rec = b.unitMainExitOf(p, rec) |
| + } |
| if p.worker != "" { |
| // A worker's end is the supervisor's to tell (W1b): |
| // the record is kept for it, never worded here. |
| @@ -501,6 +506,102 @@ func (b *ExecBackend) observe(p *unitProc) { |
| } |
| } |
| +// unitMainExitOf fills rec, an exit record with no code, from how systemd |
| +// recorded the end of p's main process, when that is p's own invocation. |
| +// On systemd 257 with PrivatePIDs a SIGKILLed unit's main process is killed |
| +// before systemd records its exit, so ExecStopPost runs with no EXIT_CODE |
| +// or EXIT_STATUS and SERVICE_RESULT "success" (Task 11, #366), while |
| +// ExecMainCode and ExecMainStatus still hold it. A read that fails, names |
| +// another invocation or recorded no exit leaves rec as it is. |
| +func (b *ExecBackend) unitMainExitOf(p *unitProc, rec instancectl.ExitRecord) instancectl.ExitRecord { |
| + read := b.UnitMainExit |
| + if read == nil { |
| + read = systemctlUnitMainExit |
| + } |
| + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| + defer cancel() |
| + m, err := read(ctx, p.unit) |
| + if err != nil { |
| + log.Printf("activator: %s: main exit of %s: %v", p.rt.Host, p.unit, err) |
| + return rec |
| + } |
| + if m.Invocation == "" || m.Invocation != p.invocation { |
| + return rec |
| + } |
| + return withMainExit(rec, m) |
| +} |
| + |
| +// withMainExit is rec with systemd's ExecMainCode and ExecMainStatus as its |
| +// code and status, the words systemd gives ExecStopPost: 1 (CLD_EXITED) is |
| +// exited with the exit code; 2 (CLD_KILLED) and 3 (CLD_DUMPED) are killed |
| +// and dumped with the signal's name where workerSignals knows it, its |
| +// number otherwise. A result of "success" (or none) stays "success" for an |
| +// end systemd counts clean (cleanMainExit) and becomes systemd's own word |
| +// for any other: exit-code, signal or core-dump, so SIGKILL's 137 is a |
| +// failure. Any other code recorded no exit, and rec is returned as it is. |
| +func withMainExit(rec instancectl.ExitRecord, m MainExit) instancectl.ExitRecord { |
| + code, status := m.Code, m.Status |
| + n, err := strconv.Atoi(status) |
| + if err != nil || n < 0 { |
| + return rec |
| + } |
| + var result string |
| + switch code { |
| + case "1", "exited": |
| + rec.Code, rec.Status, result = "exited", status, "exit-code" |
| + case "2", "3", "killed", "dumped": |
| + rec.Code, rec.Status, result = "killed", status, "signal" |
| + if code == "3" || code == "dumped" { |
| + rec.Code, result = "dumped", "core-dump" |
| + } |
| + for name, num := range workerSignals { |
| + if num == n { |
| + rec.Status = name |
| + } |
| + } |
| + default: |
| + return rec |
| + } |
| + if cleanMainExit(rec.Code, n, m.SuccessExitStatus) { |
| + result = "success" |
| + } |
| + if rec.Result == "" || rec.Result == "success" { |
| + rec.Result = result |
| + } |
| + return rec |
| +} |
| + |
| +// cleanMainExit is systemd's is_clean_exit for a service's main process |
| +// (EXIT_CLEAN_DAEMON) under the unit's own SuccessExitStatus=, as |
| +// `systemctl show` prints it (exit codes, then signal names): an exit is |
| +// clean at 0 or at a code the policy lists; a death by signal is clean for |
| +// HUP, INT, PIPE and TERM, systemd's own clean signals, or for a signal the |
| +// policy names; a core dump never is. The policy is the unit's as systemd |
| +// loaded it from the template the platform ships (internal/host/units), so |
| +// the trampoline's 129, 130, 141 and 143 stay clean without a second list |
| +// here. |
| +func cleanMainExit(code string, n int, policy string) bool { |
| + for _, f := range strings.Fields(policy) { |
| + switch code { |
| + case "exited": |
| + if v, err := strconv.Atoi(f); err == nil && v == n { |
| + return true |
| + } |
| + case "killed": |
| + if num, ok := workerSignals[strings.TrimPrefix(strings.ToUpper(f), "SIG")]; ok && num == n { |
| + return true |
| + } |
| + } |
| + } |
| + switch code { |
| + case "exited": |
| + return n == 0 |
| + case "killed": |
| + return n == workerSignals["HUP"] || n == workerSignals["INT"] || n == workerSignals["PIPE"] || n == workerSignals["TERM"] |
| + } |
| + return false |
| +} |
| + |
| // exitLine words the event line from the advisory record observe already |
| // read once and passes to both exitLine and exitLevel, so the two can |
| // never disagree from reading the file twice with something changing in |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 172d774b2..3590b7ccc 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -36,3 +36,4 @@ plan14-root-reads-fleet-secrets-key.tsv 9df7f5aca9a502966c9643b7062829c1c25bfbd8 |
| plan14-root-reads-static-headers.tsv 94b8ccf921f64be24a4773f72d55a8e24ceba3acfb40eefe3b56af6f5b008138 |
| plan14-root-reads-rootfs-check-volumes.tsv 042684bf5af6f61ce8b87f10b68a42b08d131ba4cb5bcab16320c7b032a724e6 |
| plan14-root-reads-rootfs-fleet-followups.tsv 78b7e7e30ad3ada44388a4ee16f3950ef888ae03e552477dcbfbb07c51ffb83e |
| +plan14-root-reads-rootfs-worker-exit.tsv 7ebc3871ee3c93ff168bfa62d23d6be5a970786c67a9b8aa813e8cc4e39b3d74 |
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv| new file mode 100644 |
| index 000000000..937eda2fa |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-rootfs-worker-exit.tsv |
| @@ -0,0 +1,14 @@ |
| +# Census overlay rootfs-worker-exit, written by census-propose (#369). census-ruling-rootfs-worker-exit, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-rootfs-worker-exit.md. |
| +# 1 body, 1 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 2 new dispositions: 0 reads re-frozen at their disposition with the claim, 2 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| +@legacy 654efde59dfa1b0581fdcd671633bccd26e950637a979e31e7b51dd6d7beccec internal/activator/unitproc.go ExecBackend.observe legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=final fix I3: the process observer's termination proof for a rootfs handle (Runtime, the new kind, one site) goes through unitEvents (two more Route sites): the host slice's cgroup.events and, for a rootfs unit, the group systemd reports when that is elsewhere, so a foreign invocation root placed outside the slice and could not stop is never read as gone from the absent expected path; a failed stop of a foreign invocation leaves it unstopped, asked again next poll, completion pending; a binary handle's proof is unchanged (cgroup.events under the host slice); the agent decides only whether it keeps a handle and a launch file; no root decision; re-digested at the merge of origin/main 3c33f2eb: main's own change to the observer is in the body, this branch's rootfs-aware evidence and the rootfs-only failed-stop retry (merge prep N1: a binary handle behaves exactly as main) on top; the kinds are the union;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: for a worker handle (p.worker != "") the observer keeps the exit record it read (workerExit, workerExitOK) for the supervisor instead of wording a member event, and says nothing for a replaced-after-stop or restarted-outside end; the termination evidence (cgroup.events via unitEvents, the foreign-invocation rule) and the record's single-use removal are unchanged and apply to a worker as to a generation; a binary or generation handle behaves exactly as before; the same 22 read sites, no read added;rev3=census-ruling-rootfs-worker-exit;basis=an exit record with an empty code (read and bounded as before) is filled by unitMainExitOf before it is kept for a worker or worded for the member; the termination proof (UnitState, cgroup evidence, the foreign-invocation rule) and the record's single-use removal are unchanged; the same 22 read sites, no read added registry:Host@1222,registry:Host@3062,registry:Host@3252,registry:Host@3599,registry:Host@3825,registry:Host@4529,registry:Host@5927,registry:Runtime@2414,registry:Runtime@806,whole:Route@1224,whole:Route@2222,whole:Route@2416,whole:Route@3064,whole:Route@3254,whole:Route@3601,whole:Route@3827,whole:Route@4531,whole:Route@5001,whole:Route@5479,whole:Route@5929,whole:Route@808,whole:Route@972 0e53c43116af56ded14aa9d786eb9ba4b7b2183422b8d2bf094636c0844f8b6d |
| +@legacy 76c247bc8eb0fc12169d87a85dd34085bc19418b0506ec7164c6601d1c0a9cd4 internal/activator/control.go systemctlUnitMainExit legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: runs `systemctl show -p InvocationID,ExecMainCode,ExecMainStatus,SuccessExitStatus <unit>` as the agent (no privilege), the same shape as systemctlUnitState and systemctlControlGroup; the unit name is the handle's own (unitNameFor/rootfsUnitFor), not tenant input; output parsed as four key=value strings into MainExit (Astra R1 P2: SuccessExitStatus is the unit's clean-exit policy as systemd loaded it from the shipped template) file:CommandContext@94 5ad2758610e6c9a20c7e5c3063058de728019a1e8d981c2a8b61aa9830f7794b |
| +@legacy 04397729273875f0b8aeb47ada4f5cf6b2180a799cadd47114375b31f3499593 internal/activator/unitproc.go ExecBackend.unitMainExitOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: reads the handle's unit main exit through UnitMainExit (Route.Host only for its log line), used only when the invocation systemd reports equals the handle's own; withMainExit accepts only systemd's numeric code (1, 2, 3) and a non-negative numeric status, signal names from the fixed workerSignals table; a "success" result stays success only for an end systemd counts clean (cleanMainExit: exit 0 or a code the unit's SuccessExitStatus lists, a death by HUP, INT, PIPE, TERM or a signal the policy names, never a core dump), so SIGKILL's 137 is still corrected to a failure (Astra R1 P2); it changes only the advisory record's code, status and result, which decide event wording and a worker's restart line, never termination, a lease or any root decision registry:Host@365,whole:Route@367 4b2db78929da79fa469863bf7632e755442399079f251f06a6752e12200a4dcb |
| +@legacy 6d9992edc5189954dac625f3b626db8ffaa87fee4ed86342367f06e63e0a7a30 internal/activator/rootfsworkers.go Service.noteWorkerExitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.16: the backoff, restart count and member event of one worker exit (RFS-3-C09 and RFS-3-C10); in-memory and the member's journal only;rev3=census-ruling-rootfs-worker-exit;basis=a worker that ended with no status to tell now also emits the member event RFS-3-C35 at warn (a failed start, which never ran, still gets the operator line alone, platform-39) (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent whole:Route@1256,whole:Route@1404,whole:Route@902 3c35a45e892785405bd961f29168ae230e8fea4d7202ccca499d2d4f8a4d07df |
| +internal/activator/unitproc.go ExecBackend.observe legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=final fix I3: the process observer's termination proof for a rootfs handle (Runtime, the new kind, one site) goes through unitEvents (two more Route sites): the host slice's cgroup.events and, for a rootfs unit, the group systemd reports when that is elsewhere, so a foreign invocation root placed outside the slice and could not stop is never read as gone from the absent expected path; a failed stop of a foreign invocation leaves it unstopped, asked again next poll, completion pending; a binary handle's proof is unchanged (cgroup.events under the host slice); the agent decides only whether it keeps a handle and a launch file; no root decision; re-digested at the merge of origin/main 3c33f2eb: main's own change to the observer is in the body, this branch's rootfs-aware evidence and the rootfs-only failed-stop retry (merge prep N1: a binary handle behaves exactly as main) on top; the kinds are the union;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1: for a worker handle (p.worker != "") the observer keeps the exit record it read (workerExit, workerExitOK) for the supervisor instead of wording a member event, and says nothing for a replaced-after-stop or restarted-outside end; the termination evidence (cgroup.events via unitEvents, the foreign-invocation rule) and the record's single-use removal are unchanged and apply to a worker as to a generation; a binary or generation handle behaves exactly as before; the same 22 read sites, no read added;rev3=census-ruling-rootfs-worker-exit;basis=an exit record with an empty code (read and bounded as before) is filled by unitMainExitOf before it is kept for a worker or worded for the member; the termination proof (UnitState, cgroup evidence, the foreign-invocation rule) and the record's single-use removal are unchanged; the same 22 read sites, no read added registry:Host@1222,registry:Host@3062,registry:Host@3252,registry:Host@3599,registry:Host@3825,registry:Host@4529,registry:Host@5927,registry:Runtime@2414,registry:Runtime@806,whole:Route@1224,whole:Route@2222,whole:Route@2416,whole:Route@3064,whole:Route@3254,whole:Route@3601,whole:Route@3827,whole:Route@4531,whole:Route@5001,whole:Route@5479,whole:Route@5929,whole:Route@808,whole:Route@972 0e53c43116af56ded14aa9d786eb9ba4b7b2183422b8d2bf094636c0844f8b6d |
| +internal/activator/control.go systemctlUnitMainExit legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: runs `systemctl show -p InvocationID,ExecMainCode,ExecMainStatus,SuccessExitStatus <unit>` as the agent (no privilege), the same shape as systemctlUnitState and systemctlControlGroup; the unit name is the handle's own (unitNameFor/rootfsUnitFor), not tenant input; output parsed as four key=value strings into MainExit (Astra R1 P2: SuccessExitStatus is the unit's clean-exit policy as systemd loaded it from the shipped template) file:CommandContext@94 5ad2758610e6c9a20c7e5c3063058de728019a1e8d981c2a8b61aa9830f7794b |
| +internal/activator/unitproc.go ExecBackend.unitMainExitOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-worker-exit;basis=new: reads the handle's unit main exit through UnitMainExit (Route.Host only for its log line), used only when the invocation systemd reports equals the handle's own; withMainExit accepts only systemd's numeric code (1, 2, 3) and a non-negative numeric status, signal names from the fixed workerSignals table; a "success" result stays success only for an end systemd counts clean (cleanMainExit: exit 0 or a code the unit's SuccessExitStatus lists, a death by HUP, INT, PIPE, TERM or a signal the policy names, never a core dump), so SIGKILL's 137 is still corrected to a failure (Astra R1 P2); it changes only the advisory record's code, status and result, which decide event wording and a worker's restart line, never termination, a lease or any root decision registry:Host@365,whole:Route@367 4b2db78929da79fa469863bf7632e755442399079f251f06a6752e12200a4dcb |
| +internal/activator/rootfsworkers.go Service.noteWorkerExitLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.16: the backoff, restart count and member event of one worker exit (RFS-3-C09 and RFS-3-C10); in-memory and the member's journal only;rev3=census-ruling-rootfs-worker-exit;basis=a worker that ended with no status to tell now also emits the member event RFS-3-C35 at warn (a failed start, which never ran, still gets the operator line alone, platform-39) (e.route, the entry's own route, as C09 and C10 already use), paced as C09; the operator log line is kept; in-memory state and the member's journal only; the new site is the route passed to emitEvent whole:Route@1256,whole:Route@1404,whole:Route@902 3c35a45e892785405bd961f29168ae230e8fea4d7202ccca499d2d4f8a4d07df |
| +@coverage . 7068c680e02abdbbabc3ed4f2b166399134f4da933148b538f136bbc8a72885a |
| +@coverage internal/activator 0f975ab364c941694a8ab542da085b235c07b5a7fd2d6c1ebce08e6963996d61 |
| +@coverage internal/rolloutwords 8e5a5e657c86fa4113803bbd6c46966ae9bd7e835c2f0fae552657a82998f32e |
diff --git a/internal/rolloutwords/words.go b/internal/rolloutwords/words.go| index af5fd5ee4..cd95aceb4 100644 |
| --- a/internal/rolloutwords/words.go |
| +++ b/internal/rolloutwords/words.go |
| @@ -104,16 +104,21 @@ const ( |
| // approved in the same deck: a worker the build declares beside web, |
| // filled with the worker's name first. C09's status is the exit code, or |
| // 128 plus the signal's number for a signal's end; its delay is the wait |
| -// before the restart, formatted as C11's is. |
| +// before the restart, formatted as C11's is. C35 (approved 2026-10-30, |
| +// Task 11 end-to-end) is C09 for an exit with no status to tell. |
| const ( |
| - EventWorkerStarted = "worker %s started" // RFS-3-C08 |
| - EventWorkerExited = "worker %s exited with status %d. starting it again in %s" // RFS-3-C09 |
| - EventWorkerCrashLoop = "worker %s keeps exiting. it is started again once a minute" // RFS-3-C10 |
| + EventWorkerStarted = "worker %s started" // RFS-3-C08 |
| + EventWorkerExited = "worker %s exited with status %d. starting it again in %s" // RFS-3-C09 |
| + EventWorkerCrashLoop = "worker %s keeps exiting. it is started again once a minute" // RFS-3-C10 |
| + EventWorkerExitedUnknown = "worker %s exited. starting it again in %s" // RFS-3-C35 |
| ) |
| // States: the REASON column of `carlos instances list` (spec §9.1). |
| +// StateHeldBecause is StateHeld when the box says why, filled with |
| +// Reason's phrase (zdd.state.held-because, approved 2026-10-30). |
| const ( |
| StateHeld = "held: build %s failed on this box" |
| + StateHeldBecause = "held: build %s failed on this box, because %s" |
| StateRollingOut = "rolling out" |
| StateAsleep = "starts %s on its next request" |
| StateConfigPending = "config delivered, not active" |
diff --git a/internal/rolloutwords/words_test.go b/internal/rolloutwords/words_test.go| index 44dbcd88f..4cc2e150f 100644 |
| --- a/internal/rolloutwords/words_test.go |
| +++ b/internal/rolloutwords/words_test.go |
| @@ -20,6 +20,7 @@ func allWords() map[string]string { |
| "EventReleaseStarted": EventReleaseStarted, "EventReleaseDone": EventReleaseDone, |
| "EventReleaseFailed": EventReleaseFailed, "EventReleaseSignal": EventReleaseSignal, |
| "EventReleaseTimedOut": EventReleaseTimedOut, "EventReleaseLeaseLost": EventReleaseLeaseLost, |
| + "EventWorkerExitedUnknown": EventWorkerExitedUnknown, "StateHeldBecause": StateHeldBecause, |
| } |
| for k, v := range causes { |
| out["cause "+k] = v |
| @@ -56,7 +57,8 @@ func TestVerbsAreWhereTheCallersPutThem(t *testing.T) { |
| "StateHeld": 1, "StateRollingOut": 0, "StateAsleep": 1, "StateConfigPending": 0, "reasonUnknown": 1, |
| "unavailableUnknown": 1, "EventRootfsRefused": 1, "RootfsRefusedUnarmed": 0, |
| "EventReleaseStarted": 1, "EventReleaseDone": 2, "EventReleaseFailed": 1, "EventReleaseSignal": 2, |
| - "EventReleaseTimedOut": 2, "EventReleaseLeaseLost": 1, |
| + "EventReleaseTimedOut": 2, "EventReleaseLeaseLost": 1, "EventWorkerExitedUnknown": 2, |
| + "StateHeldBecause": 2, |
| } { |
| s := words[name] |
| d := digits[name] |
diff --git a/plan3_groups_test.go b/plan3_groups_test.go| index bc33757c1..d61b9ad87 100644 |
| --- a/plan3_groups_test.go |
| +++ b/plan3_groups_test.go |
| @@ -34,7 +34,8 @@ import ( |
| // The copy sets, pinned. RFS-3-C13 is struck (pre-flight 3.1) and |
| // in no set; so is RFS-3-C25 (Paul's Task 15 round 3 ruling), whose place |
| -// RFS-3-C30 to C34 take. |
| +// RFS-3-C30 to C34 take. RFS-3-C35 (approved 2026-10-30 after the Task 11 |
| +// end-to-end run) is a worker event, so it is Group W's. |
| // |
| // plan3CopyRuns is Task 12's carlos run rows (--version and rootfs runs), |
| // cut by Paul 2026-10-26, for a later rootfs-runs task (#431). It is a |
| @@ -43,7 +44,7 @@ import ( |
| var ( |
| plan3CopyA = plan3IDs(11, 12, 14, 15, 16, 23, 24, 30, 31, 32, 33, 34) |
| plan3CopyR = plan3IDs(1, 2, 3, 4, 5, 6, 7, 29) |
| - plan3CopyW = plan3IDs(8, 9, 10) |
| + plan3CopyW = plan3IDs(8, 9, 10, 35) |
| plan3CopyRuns = plan3IDs(17, 18, 19, 20, 21, 22, 26, 27, 28) |
| ) |