smoke-private-path: preflight a host-memory floor — earlyoom killed the guest mid-drive, twice, as a confusing deep red #375

Closed
opened 2026-08-09 21:11:54 +00:00 by ben · 2 comments
Owner

Found by the #183 rehearsal ratchet's Task-3 gate drives (2026-08-09,
runs 20260809T204304Z + 20260809T205457Z). Both drives died 6-7 minutes
in at enroll-activate because the HOST hit earlyoom's 10% floor (swap
already 100% full) and earlyoom SIGTERMed the 4 GiB qemu guest:

qemu-system-x86_64: terminating on signal 15 from pid 961 (/usr/bin/earlyoom)

The harness exists to turn confusing failures into named ones
(scripts/smoke-private-path.sh's own words), and this failure mode
currently surfaces as a deep journey red plus a WRONG classifier remedy
(#374). It must be a named refusal at second 0 instead.

Shape: in the preflight block (beside the /dev/kvm gate), read
MemAvailable from /proc/meminfo and refuse (die_host) when it is below
the guest's allocation (4096 MiB, see the qemu -m in the unit) plus a
drive-stack allowance (electron + chromium + builds; ~2 GiB — tune from the
two runs' evidence: both kills came with qemu VmRSS ~3.2-3.7 GiB and avail
at 1.38 GiB). Name earlyoom in the message when /usr/bin/earlyoom is
present, since it makes the kill CERTAIN rather than possible. A
swap-nearly-full warning line (not a refusal) is worth printing too.

Acceptance:

  • Given MemAvailable below the floor, when the harness preflights, then
    it refuses with a PREFLIGHT: line naming the numbers and the remedy
    (close consumers / run on a bigger host), before any build
  • Given a healthy host, when the harness preflights, then behaviour is
    unchanged
  • The floor is a named constant with the two runs' evidence in a comment
Found by the #183 rehearsal ratchet's Task-3 gate drives (2026-08-09, runs `20260809T204304Z` + `20260809T205457Z`). Both drives died 6-7 minutes in at `enroll-activate` because the HOST hit earlyoom's 10% floor (swap already 100% full) and earlyoom SIGTERMed the 4 GiB qemu guest: qemu-system-x86_64: terminating on signal 15 from pid 961 (/usr/bin/earlyoom) The harness exists to turn confusing failures into named ones (`scripts/smoke-private-path.sh`'s own words), and this failure mode currently surfaces as a deep journey red plus a WRONG classifier remedy (#374). It must be a named refusal at second 0 instead. Shape: in the preflight block (beside the /dev/kvm gate), read `MemAvailable` from /proc/meminfo and refuse (`die_host`) when it is below the guest's allocation (4096 MiB, see the qemu `-m` in the unit) plus a drive-stack allowance (electron + chromium + builds; ~2 GiB — tune from the two runs' evidence: both kills came with qemu VmRSS ~3.2-3.7 GiB and avail at 1.38 GiB). Name earlyoom in the message when /usr/bin/earlyoom is present, since it makes the kill CERTAIN rather than possible. A swap-nearly-full warning line (not a refusal) is worth printing too. Acceptance: - [ ] Given MemAvailable below the floor, when the harness preflights, then it refuses with a PREFLIGHT: line naming the numbers and the remedy (close consumers / run on a bigger host), before any build - [ ] Given a healthy host, when the harness preflights, then behaviour is unchanged - [ ] The floor is a named constant with the two runs' evidence in a comment
Author
Owner

Landed as 3d49b67 on origin/main. scripts/smoke-private-path.sh now preflights a host-memory floor beside the /dev/kvm gate: it reads MemAvailable from /proc/meminfo and die_hosts (PREFLIGHT: line, before any build) when it is below OC_HOST_MEM_FLOOR_MIB=6144 (4096 MiB founding guest per GatewayFloor in internal/founding/standup.go + ~2048 MiB drive stack). The refusal names the numbers and the remedy (close consumers / bigger host); when /usr/bin/earlyoom is present it says the kill is CERTAIN. A swap ≥90%-full WARNING (not a refusal) is printed too. The floor is a named constant carrying the two runs (20260809T204304Z + 20260809T205457Z) evidence in its comment. A healthy host is unchanged; a kernel with no MemAvailable line prints a note and skips.

Verified against synthetic /proc/meminfo: the 1.38 GiB kill point refuses with exit 3 and the numbers; a healthy host passes; swap 95% warns but passes; a missing MemAvailable line skips gracefully. All three acceptance clauses met.

Landed as 3d49b67 on origin/main. `scripts/smoke-private-path.sh` now preflights a host-memory floor beside the /dev/kvm gate: it reads MemAvailable from /proc/meminfo and `die_host`s (PREFLIGHT: line, before any build) when it is below `OC_HOST_MEM_FLOOR_MIB=6144` (4096 MiB founding guest per GatewayFloor in internal/founding/standup.go + ~2048 MiB drive stack). The refusal names the numbers and the remedy (close consumers / bigger host); when /usr/bin/earlyoom is present it says the kill is CERTAIN. A swap ≥90%-full WARNING (not a refusal) is printed too. The floor is a named constant carrying the two runs (20260809T204304Z + 20260809T205457Z) evidence in its comment. A healthy host is unchanged; a kernel with no MemAvailable line prints a note and skips. Verified against synthetic /proc/meminfo: the 1.38 GiB kill point refuses with exit 3 and the numbers; a healthy host passes; swap 95% warns but passes; a missing MemAvailable line skips gracefully. All three acceptance clauses met.
ben closed this issue 2026-08-09 21:46:45 +00:00
Author
Owner

Third earlyoom kill of the day, from the Nextcloud-provision drive (20260809T215349Z, worktree bridge-cse):

  • Kill: 17:05:40 local — earlyoom: mem avail: 1376 of 13844 MiB (9.94%), swap free: 37 of 4095 MiB (0.92%) — at or below SIGTERM limits: mem 10%, swap 10%. The sweep took mattermost, chrome, and the guest's qemu; ourcloud-guest.service restart counter hit 1 at 17:05:46, and the drive's enroll-activate leg red'd as "disk could not be laid out" when its SSH died mid-step.
  • Gate-tuning datum: at drive LAUNCH the host looked fine by RAM alone — MemAvailable 6.5 GiB — but SwapFree was already 676 MiB of 4 GiB. With swap pre-exhausted, the whole spike lands on RAM and the 10% floor arrives fast. The preflight gate should refuse (or at least warn) on swap, not just MemAvailable — suggested shape: require MemAvailable ≥ 8 GiB OR (MemAvailable ≥ 6 GiB AND SwapFree ≥ 2 GiB).
  • Window-widener (separate concern): this drive's enroll-activate did uncached guest-side work the morning greens never did (github flake unpacks + a sops-install-secrets source build at the disk step) — both today's post-payload-rebuild drives hit it. That lengthens the high-pressure window; I'll file it separately once my headroom re-drive isolates it from the memory kill.
Third earlyoom kill of the day, from the Nextcloud-provision drive (`20260809T215349Z`, worktree bridge-cse): - **Kill:** 17:05:40 local — `earlyoom: mem avail: 1376 of 13844 MiB (9.94%), swap free: 37 of 4095 MiB (0.92%) — at or below SIGTERM limits: mem 10%, swap 10%`. The sweep took mattermost, chrome, and the guest's qemu; `ourcloud-guest.service` restart counter hit 1 at 17:05:46, and the drive's `enroll-activate` leg red'd as "disk could not be laid out" when its SSH died mid-step. - **Gate-tuning datum:** at drive LAUNCH the host looked fine by RAM alone — MemAvailable 6.5 GiB — but **SwapFree was already 676 MiB of 4 GiB**. With swap pre-exhausted, the whole spike lands on RAM and the 10% floor arrives fast. The preflight gate should refuse (or at least warn) on swap, not just MemAvailable — suggested shape: require MemAvailable ≥ 8 GiB OR (MemAvailable ≥ 6 GiB AND SwapFree ≥ 2 GiB). - **Window-widener (separate concern):** this drive's `enroll-activate` did uncached guest-side work the morning greens never did (github flake unpacks + a `sops-install-secrets` source build at the disk step) — both today's post-payload-rebuild drives hit it. That lengthens the high-pressure window; I'll file it separately once my headroom re-drive isolates it from the memory kill.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#375
No description provided.