Repository navigation
Bound Git requests by their body and response progress - #580
Merged
Merged
Conversation
Contributor
|
This conflicts with main in |
upload-pack was started with its stdin attached to the request body, after the read deadline had been extended to two hours, and ls-refs requests took no slot. A client that sent part of a request and then nothing kept an upload-pack process waiting, and any number of them could. Stateless requests are complete once sent, so the handler now reads the body in full first, within the server's read timeout, keeping bodies past 1 MiB in a temporary file. Only then are the deadlines extended for the response. info/refs and ls-refs share their own slots, four per CPU, so they still never wait behind clones. Each response write is bounded to two minutes, so a client that stops reading a pack frees its slot instead of holding it until the request timeout.
simonchrz
force-pushed
the
fix/git-request-limits
branch
from
October 24, 2026 11:03
813260d to
77bd66a
Compare
Contributor
Author
|
Rebased onto main, CI is green. |
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.
Hardens how long a Git request can hold an upload-pack process.
ls-refsandinfo/refstook no slot. They now share their own (four per CPU), so they still don't wait behind clones.Lease.ServeUploadPacknow takes the body from the newCache.ReadRequest.Tests:
TestGitSlowRequestBodyStartsNothing(part of a body, then nothing: answered at the read timeout),TestGitStalledClientIsDropped(16 MB pack never read: the handler returns),TestRefListingSlots,TestReadRequest. The first three fail without the change.