fix(file-patch): serialize concurrent updates - #802
Draft
Whxuan0701 wants to merge 1 commit into
Draft
Conversation
Author
|
Implementation and deterministic thread/process regression tests are ready in this draft. The POSIX flock path was exercised on macOS 14.6.1; the Windows msvcrt path awaits Windows CI/maintainer validation. |
Whxuan0701
force-pushed
the
fix/file-patch-race
branch
from
September 8, 2026 09:13
9c957c2 to
639331f
Compare
Whxuan0701
force-pushed
the
fix/file-patch-race
branch
from
September 8, 2026 09:20
639331f to
64efa06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #799
What
file_patch()read-modify-write transaction with a per-path thread lock.Why
Two subagents could read the same file version, calculate disjoint edits, both return
success, and have the last writer silently erase the first edit. The lock makes the read/validate/write sequence one transaction per path; a later conflicting patch now sees current content and follows the existing validation behavior.Validation
f6e5657: deterministic delayed-read reproduction returns success twice but leaves only one edit.python -m py_compile ga.pyandgit diff --checkpassed.Boundary
The POSIX
flockpath was exercised on macOS. The Windows path uses the standard-librarymsvcrt.lockingAPI but was not run on a Windows host; Windows CI feedback is welcome while this remains a draft.