Relationships
#2930 Method-run records left running by a dead owner are never reaped
Opened by hammz · 10/1/2026· Shipped 10/2/2026
Description
Found while triaging swamp-club#2918. When the process that owns a method run dies before saving the run's final state (second Ctrl-C force exit, the canceller's SIGKILL after OWNER_STOP_GRACE_MS, a crash, or a method that ignores its signal past the owner's step stop grace), the method-run output record (ModelOutput, saved by markRunning with the owner's pid) stays at running forever with no completedAt.
Nothing reconciles these records: run doctor --fix, workflow recover and settleDeadOwnerRun (src/domain/workflows/orphaned_run_reaper.ts) settle workflow-run records only, and serve's boot reaper does the same. In addition, swamp workflow cancel does not complete the method-run tracker rows owned by the process it stopped (only swamp model cancel does), so those rows stay running until a stale-run reap.
Steps to reproduce
- Run a workflow whose shell step ignores SIGTERM for longer than the owner's grace, or force-exit the owner with a second Ctrl-C while a step runs.
- swamp model method history search --json
Expected
A method-run record still at running whose recorded pid is no longer alive is settled (cancelled or interrupted, with completedAt) by the same paths that settle dead-owner workflow runs (settleDeadOwnerRun / run doctor --fix / workflow cancel), and workflow cancel completes the stopped owner's method tracker rows as model cancel does.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.