Skip to content

Conversation

mostynb
Copy link
Contributor

@mostynb mostynb commented Sep 16, 2025

I believe that this value was intended to help clients and servers avoid exceeding gRPC message length limits, which default to 4Mb in most configurations.

When dealing with uncompressed blobs, the total size of the blobs is often approximately equal to the size of the serialized protobuf message. However this approximation is much less reliable when compressed blobs are involved in response messages (where the client doesn't know ahead of time how large the compressed blobs are).

We should therefore describe this limit as referring to the size of the serialized requests/responses, and not of the approximation using the sizes of the blobs (either uncompressed or compressed).

Resolves #344.

…e serialized protobuf messages, not the blobs

I believe that this value was intended to help clients and servers
avoid exceeding gRPC message length limits, which default to 4Mb in
most configurations.

When dealing with uncompressed blobs, the total size of the blobs is
often approximately equal to the size of the serialized protobuf message.
However this approximation is much less reliable when compressed blobs
are involved in response messages (where the client doesn't know ahead
of time how large the compressed blobs are).

We should therefore describe this limit as referring to the size of
the serialized requests/responses, and not of the approximation using
the sizes of the blobs (either uncompressed or compressed).

Resolves bazelbuild#344.
@mostynb mostynb requested a review from ulfjack as a code owner September 16, 2025 16:33
Comment on lines +384 to +386
// * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob,
// or if the size of the serialized BatchUpdateBlobsResponse message exceeds
// [CacheCapabilities.max_batch_total_size_bytes][build.bazel.remote.execution.v2.CacheCapabilities.max_batch_total_size_bytes].
Copy link
Contributor Author

@mostynb mostynb Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure about this part- I need to check what gRPC implementations actually return in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we got something like code = ResourceExhausted desc = gRPC message exceeds maximum size 4194304: 4196713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

max_batch_total_size_bytes can not be correctly implemented at server side?
2 participants