Skip to content

prove lock: stale lock on non-Unix and create-to-pid race #3

Open

Description

@jerryfane

Review P3 findings from job local-review-review-router-18d8b041aad26ed9-1 on PR #1 (head 8c2204b4). Both fail safe; filed so they are not lost.

  1. On non-Unix builds, processAlive always returns true. A lock left by a crashed run is never taken over, and the error does not say to delete .git/test-check-prove.lock.
  2. acquire creates the lock with O_EXCL and writes the pid in a separate step. A concurrent run that reads the empty file in between treats it as stale. errStashTaken still prevents corruption, so the worst case is a spurious refusal. Fix: write the pid to a temp file and link it into place atomically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions