earlyoom killed the guest mid-deploy — drive died as a confusing ssh-refused; guest needs OOM protection + guest-death detection + availability-aware floor #553
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#553
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
2026-08-15 tier-1 drive (post-#549): the deploy failed at the control-plane row with
The port was correct and the unit healthy — the guest itself was dead. Its final console line (user journal, decoded):
The HOST ran out of memory mid-founding (14 GB machine: guest ~3.6 GB + host-side clan/nix evaluation + the app + operator browser; swap 4/4 GB full) and earlyoom chose qemu — the biggest RSS — as its victim.
Restart=nois by design for the app-tied user-scope guest (#427), so the guest stayed down and the deploy walked into a refused SSH forward.Three rules worth pulling out
Protect the guest from userspace OOM killers during founding. The guest is the single most load-bearing process of the whole journey; the unit should carry
OOMScoreAdjust=(and considerManagedOOMPreference=avoid) so earlyoom/systemd-oomd prefer any other victim. earlyoom by default SIGTERMs the largest process — which the gateway VM will almost always be on an operator laptop.A dead guest should fail as "the VM stopped", not as a connection error. The deploy seam already knows the guest unit; on any transport failure it should check
is-activefirst and report the guest's death (with the earlyoom line — it is right there in the unit journal) instead of surfacingssh: Connection refusedto the operator.The hardware-floor probe checks capacity, not availability. The S9 card passed 14 GB total while available memory + full swap could not actually sustain guest + deploy concurrently. The probe (or a pre-deploy check) should consider MemAvailable against the guest size + deploy headroom and warn before standing up, not fail confusingly mid-leg.
Proof
Under artificial memory pressure (or an earlyoom simulation killing qemu mid-deploy): the drive fails with an explicit "the local VM stopped (killed by the system's out-of-memory guard)" fault carrying the journal evidence — and with the unit protection in place, earlyoom picks a different victim in the first place.
Incident from the 2026-08-15 fix-verification drive; chained after #549 (fixed) and #550 (open).
Verification: Confirmed no existing guest-side OOM protection or guest-death-aware transport error reporting in the codebase —
earlyoom/OOM handling only appears in the masked-exit log-classification path (internal/clan/errors.go, #374), which detects an OOM kill after the fact in copy logs; it does not protect the guest process itself or reclassify a resulting SSH connection-refused as a guest death. Redundancy check: not already implemented.Agent Brief
Category: bug
Summary: The founding guest VM has no OOM-kill protection and its death surfaces to the operator as a confusing SSH connection-refused instead of an honest "the VM was killed" fault; the hardware-floor probe also doesn't account for available memory headroom during a live deploy.
Current behavior:
On a host under memory pressure, userspace OOM killers (earlyoom, systemd-oomd) are free to pick the guest VM process as their victim — it is typically the largest RSS process on an operator's machine during founding. The guest's systemd unit deliberately does not auto-restart (by design, for the app-tied user-scope guest). When the guest is killed mid-deploy, the deploy's SSH-based transport to the guest fails with a generic connection-refused error; nothing in the deploy path checks whether the guest unit itself is still active, so the operator sees a transport error with no indication the guest died, let alone why. Separately, the pre-deploy hardware-floor probe checks total memory capacity but not available memory/swap headroom, so it can pass on a machine that cannot actually sustain guest + deploy concurrently.
Desired behavior:
OOMScoreAdjust, and consideringManagedOOMPreference=avoid).MemAvailable(including swap) against the guest's memory footprint plus deploy headroom, and warns before stand-up begins rather than failing confusingly mid-leg.Key interfaces:
systemctl is-activeor equivalent) before surfacing a transport error, and a distinct fault type/message for "guest process killed by OOM guard" that carries journal evidence.Acceptance criteria:
Out of scope:
Restart=noon the guest unit (deliberate, per #427) — this ticket is about who the OOM killer picks and how death is reported, not about auto-restarting the guest.swarm-claim host=matou-dev-server-01 run=6503
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #553 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope