Skip to content

Worker hangs if plan-cluster or review-results never exits #313

Description

@SebTardif

A wedged plan-cluster.mjs or review-results.mjs child can pin a cluster worker forever. Codex already has CLOWNFISH_CODEX_TIMEOUT_MS. The planner and review-results spawnSync calls in scripts/run-worker.mjs have no deadline.

What happens

  1. node scripts/run-worker.mjs <job.md> runs scripts/plan-cluster.mjs (and later scripts/review-results.mjs) via spawnSync with no timeout.
  2. If that child never exits, the worker holds the slot until someone kills the process.

Proposed fix

Give those children the same timeout contract as Codex:

  • CLOWNFISH_PLANNER_TIMEOUT_MS (default 10 minutes)
  • CLOWNFISH_REVIEW_TIMEOUT_MS (default 10 minutes)
  • On ETIMEDOUT, write a blocked result and exit 0 (same as the Codex timeout path)

A source test in test/run-worker-source.test.mjs checks that the timeout wiring is present.

Fork branch

This repo limits pull requests to collaborators, so I could not open a PR. The patch is on my fork:

Feel free to cherry-pick that commit, or I can open a PR if you add this account as a collaborator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExempts this issue from stale automation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions