Skip to content

Prevent overlapping checks from executing the same stages twice #1528

Done

Description

@eowca

Problem

Two plain loopzero check callers can start expensive work concurrently for the same checkout, HEAD and settings before either has a complete receipt. The existing task-state lock covers receipt publication, not execution. #1368 protects the result of concurrent writers. This issue is about preventing duplicate stage execution, including the interval when no pass can yet be reused by #1526.

Capacity evidence

From 25 Nov 03:28:50Z to 26 Nov 03:28:50Z, Three checks began before an earlier check at the same head for the same mapped PR or worktree ended. Generic worktree basenames were excluded unless the PR was independently matched. Two later checks had a prior successful overlapping run at the same clean head, logged base and command. They used 10.3 run-wall minutes and 10.2 recorded CPU minutes, 0.14% and 0.08% of all recorded check-wrapper wall and CPU time. The logs do not guarantee identical effective settings.

Offline reproduction and acceptance

  • Use an existing temporary-repo CLI concurrency fixture. Stub a stage to pause after Check A starts, then invoke Check B on the same checkout, clean HEAD and settings.
  • Reuse existing task coordination to prevent the second invocation from starting a duplicate stage in that checkout. Let it report a check already in progress or reuse the completed pass. If the first run fails or is interrupted, a later invocation can run normally. Distinct checkouts or heads stay independent unless the existing coordinator can establish a shared execution. Do not serialize unrelated work.
  • Preserve receipt publication and readiness validation. Keep tests net-zero in lines and preserve coverage. Add no flags, config keys or state.

Activity

  1. eowca commented on Nov 26, 2026

    @eowca
    ContributorAuthor

    Parked (Lean178, 26 Nov): draft #1557 (head 2c53ecaa) passes checks, but two lock findings remain and the proposed persistent lock file conflicts with the keep-minimal rule (no new state files). A future attempt should avoid new on-disk state, for example by reusing an existing lock or receipt, or should be closed as not worth the cost.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions