diff options
| author | Mohamed Hegazy <mhegazy@anthropic.com> | 2026-10-23 11:31:29 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-10-23 11:31:29 +0000 |
| commit | 51b34378d6c2efb5897120c322438e17763854fc (patch) | |
| tree | 32026c33f9c29819b71d73e9cdf5d6df8e031b49 /plugins/code-modernization/scripts/baseline_diff.py | |
| parent | 465f09344424225c25d438f2e052732c3d688d2f (diff) | |
security-guidance: hold in-flight review markers on native Windows too
A commit or push review marks the commits it is reviewing by holding a
lock on .git/sg-inflight-<sha>, so a push made meanwhile waits for that
review instead of reviewing the same commit again. The lock was flock
only. Native Windows Python has no fcntl, so there were no markers there
and a push right after a commit still ran a second full review.
On Windows the same shared/exclusive, never-waiting lock is now taken
with LockFileEx, on a byte far past the end of the empty marker so that
reading or copying the file is never refused. Windows will not delete an
open file, so a marker is closed before it is deleted there, with a short
retry while another review has it open; what cannot be deleted is left
unlocked and swept once old, as before.
Also: one marker that cannot be opened, or whose last holder deletes it
between this review's open and lock, no longer costs the review its
claim on the remaining commits.
The in-flight tests no longer require fcntl, so they run on Windows.
Diffstat (limited to 'plugins/code-modernization/scripts/baseline_diff.py')
0 files changed, 0 insertions, 0 deletions
