Repository navigation
session: serve the session with grpc's transport so streams apply flow control - #7437
Merged
Merged
Conversation
…w control The session's gRPC server was served through ServeHTTP on an x/net/http2 server. grpc-go's ServeHTTP transport reads request bodies eagerly into an unbounded buffer and returns flow-control credit as it reads, so a stream the handler consumes slowly never pushes back on the sender. An export to the client (type=oci/docker/tar with dest=) that the client writes slower than the daemon sends grows the client's memory by the backlog, up to the whole export. Serve the connection with grpc.Server.Serve on a listener that hands out that one connection, so grpc's own transport applies flow control. The x/net/http2 server and its header-count setup are no longer needed: grpc's transport has no per-value header count limit. Fixes moby#7435 Signed-off-by: Fedor Rubalskiy <245945217+fedor-rubalskiy@users.noreply.github.com>
Set an explicit 1 MiB header-list limit on the session gRPC server, matching the previous HTTP/2 server's budget. This keeps large filesync pattern lists working when GRPC_GO_EXPERIMENTAL_ENABLE_8KB_DEFAULT_HEADER_LIST_SIZE=true. The smaller default was introduced in grpc/grpc-go#9019. See grpc/grpc-go#9019 Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Extend the flow-control test to release the blocked reader, check sender errors, and verify the received byte count and successful stream completion. This prevents stream failures or permanent stalls from being mistaken for working flow control. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
crazy-max
approved these changes
Nov 18, 2026
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.
carry #7436
closes #7436
closes #7435
@fedor-rubalskiy