Disable automatic Git maintenance in cloner#4554
Open
winor30 wants to merge 1 commit into
Open
Conversation
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.
What
This disables Git's automatic maintenance while the git cloner is preparing a temporary checkout for
CloneToBucket.The cloner now passes these config overrides to the Git commands that operate on the temporary clone:
The regression test checks the actual Git argv via
GIT_TRACE2_EVENT, so it pins down that these options are passed beforefetch,checkout, andsubmodule.Why
I ran into this through
bufbuild/buf-breaking-action@v1on GitHub Actions. The action failed while cloning theagainstinput with missing files under.git:That run was on
ubuntu-24.04with Git 2.54.0.The cloner creates a temporary Git repository, runs
fetch/checkout/optional submodule commands, and then copies the result into a storage bucket. In the affected path,.gitfiles can be part of that copy. If Git kicks off automatic maintenance or GC around the same time, it can create and remove temporary files under.gitwhilestorage.Copyis walking the directory. That leavesstorage.Copywith a path it saw during the walk, but can no longer stat/open.I verified the race with a local reproducer that puts a small
gitwrapper at the front ofPATH. The wrapper delegates to the real Git binary, but aftergit fetchit simulates background Git maintenance by creating files under.git/buf-copy-raceand deleting them whileCloneToBucketis copying the checkout.On
main, cloning with no matcher fails in the same way:On this branch, the same reproducer passes because the maintenance-simulating path is not started.