Repository navigation
fix(git): stop snapshot generation from stalling every request - #412
Merged
Merged
Conversation
luispadron
force-pushed
the
luis/repo-lock-hot-fields
branch
from
September 30, 2026 16:29
9d0aa1b to
041d4dd
Compare
luispadron
marked this pull request as ready for review
September 30, 2026 16:31
luispadron
requested review from
jrobotham-square
and removed request for
a team
September 30, 2026 16:31
worstell
approved these changes
Sep 30, 2026
Ref-check and last-fetch bookkeeping took the repository RWMutex for writing on every request and every fetch. Snapshot generation holds that lock for reading for minutes on large mirrors, and a queued writer makes RWMutex park every new reader behind it, so serving (State(), for-each-ref, snapshot downloads) hung until generation finished and clients timed out. Move the bookkeeping to its own mutex so only state transitions ever write the repository lock. Also fetch and retry the mirror when upload-pack reports "not our ref" before forwarding to upstream: on busy repositories the missing object is almost always a commit the stale mirror simply has not fetched yet, and forwarding proxied the entire pack from upstream. Tests: the quay.io/minio/minio image is no longer published, so the S3 test container now uses cgr.dev/chainguard/minio.
luispadron
force-pushed
the
luis/repo-lock-hot-fields
branch
from
September 30, 2026 17:24
041d4dd to
7861357
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.
Ref-check and last-fetch bookkeeping took the repository
RWMutexfor writing on every request and every fetch. Snapshot generation holds that lock for reading for minutes on large mirrors, and a queued writer parks every new reader behind it, so serving hung until generation finished. The bookkeeping now lives under its own mutex; only state transitions write the repository lock.Also fetch and retry the mirror when upload-pack reports "not our ref" before forwarding to upstream. On busy repositories the missing object is usually a commit the stale mirror has not fetched yet, and forwarding proxied the whole pack from upstream.
Tests:
quay.io/minio/miniois no longer published (CI has been failing onmainsince Sep 24), so the S3 test container now usescgr.dev/chainguard/minio.