Repository navigation
Avoid GVFS command locks for read-only Git operations - #2138
Merged
Tyrie Vella (tyrielv) merged 1 commit intoOct 28, 2026
Merged
Tyrie Vella (tyrielv) merged 1 commit into
Tyrie Vella (tyrielv) merged 1 commit into
Conversation
Tyrie Vella (tyrielv)
force-pushed
the
tyrielv/read-only-command-locks
branch
from
October 19, 2026 22:11
abe3253 to
569290d
Compare
Exempt worktree list without relaxing locks for other worktree subcommands. Also exempt audited history, ref-query, object-statistics, and verification operations. Default annotate follows the existing blame policy for working-tree reads. Neither command provides snapshot isolation. Share the hook policy with unit coverage through a partial source file. Add deterministic first-open coverage during a paused worktree-list command. Cover read-only commands under contention and preserve normal status waits. Keep test lock holders alive only for the synchronous test action. Require lock readiness before the action and cover retained dispatcher waits. Use producer-shaped pre-command and post-command metadata in the unit cases. Assisted-by: GPT-6.1 Sol Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Tyrie Vella (tyrielv)
force-pushed
the
tyrielv/read-only-command-locks
branch
from
October 21, 2026 15:43
569290d to
64f6ad8
Compare
Tyrie Vella (tyrielv)
marked this pull request as ready for review
October 21, 2026 15:45
Tyrie Vella (tyrielv)
enabled auto-merge
October 21, 2026 15:45
Nathan Baird (ShiningMassXAcc)
left a comment
Member
There was a problem hiding this comment.
The new read-only-command cases pass in CI, but no changed-line coverage report is published. Please link a report if available, or record this limitation alongside the targeted lock/no-lock test evidence in the PR validation notes. This is nonblocking.
Contributor
Author
|
Note 🤖 Machine-drafted reply — reviewed and approved by Tyrie Vella. Nathan Baird (@ShiningMassXAcc), added a Validation section with the targeted lock/no-lock test evidence and the explicit changed-line coverage limitation. The pipeline does not currently collect coverage. I will investigate configuring it separately, including the NativeAOT limitation for functional coverage. |
Nathan Baird (ShiningMassXAcc)
approved these changes
Oct 28, 2026
Tyrie Vella (tyrielv)
merged commit Oct 28, 2026
b28ddc5
into
microsoft:master
68 of 69 checks passed
This was referenced Nov 2, 2026
Merged
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.
Problem and Context
The command hook takes the global GVFS lock for every worktree subcommand, including the read-only
worktree listcommand. During that lock, GVFS rejects new ordinary-file placeholders withFileNotFound. An unrelated process can therefore fail to open a tracked file that exists in the projection.Several other Git commands also take this lock even though they do not change index membership or tracked working-tree content. Long commands can extend the period in which unrelated first opens fail.
Like
blame, defaultannotatereads working-tree files. This change does not serialize those reads with concurrent worktree mutations. The exclusion also lets defaultannotatecreate its own file placeholders.Changes
worktree list, including porcelain and NUL-delimited output. Keep locks for mutating and unknown worktree subcommands.annotate,check-ref-format,cherry,count-objects,ls-remote,range-diff,shortlog,show-branch,verify-commit,verify-pack, andverify-tag.describe, whose--dirtyand--brokenmodes can write the index. Preserve the existing lock classification for index mutators and arbitrary-command dispatchers.annotateon an unmaterialized file. The contention tests assert lock readiness before they run each command and release the test lock holder before each test returns.statusandfor-each-repostill wait for the lock, with controlled alias configuration in the dispatcher test.The placeholder rejection policy and alias detection remain unchanged. This change does not introduce deferred file opens.
Validation
CI run 39628260944 tested head
64f6ad82.Targeted functional tests passed for first opens during paused
worktree list, defaultannotate, read-only lock bypass, and retainedstatus/for-each-repowaits. With theworktree listexemption temporarily removed, the same direct-read regression failed withFileNotFoundException.The pipeline does not collect coverage, so no changed-line coverage report is available for this head. The evidence establishes tested behavior, not measured coverage of every changed line.