Skip to content

porch: machine-wide lock for heavy checks so concurrent builders stop saturating the machine #1892

Open

Description

@waleedkadous

Problem

Several builders running end-of-phase checks at once (porch done, full test suites) saturate the machine, and runs fail on timeouts unrelated to the change.

Field evidence from a multi-architect adopter workspace (7 architects, ~10 builders, one machine, codev 3.3.7), sent at the owner's request on 2026-11-11. There, concurrent heavy checks drove load to 35 and failed runs. They now serialise by messages: a builder says 'suite ready', an architect relays, the main architect grants a 'slot'. It is enforced from memory, was broken twice in one day, and one PR needed three separate grants.

Independent observation on the maintainer's machine, 2026-11-09: one builder's test run in another workspace spawned 324 vitest workers on 18 cores, load average hit 315, and typing in every terminal on the machine stalled until it finished.

Suggested

  • porch takes a machine-wide lock (configurable concurrency, default 1) around checks marked heavy in the protocol or in .codev/config.json, queues behind it, and prints its queue position.
  • afx spawn's postSpawn install respects the same lock.
  • The lock must be machine-wide, not per-workspace: the contention is across workspaces sharing one Tower. Tower (or a lock file under ~/.agent-farm/) is the natural holder; a crashed holder must not wedge the queue (pid-liveness check, loud takeover).

Not spawned; this needs a short design (where the lock lives, how 'heavy' is declared), so ASPIR or SPIR rather than BUGFIX.

Activity

  1. added
    area/porch
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/porch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions