Skip to content

fix(storage): increase gRPC response metadata limit - #14687

Draft
span-lh wants to merge 1 commit into
googleapis:mainfrom
span-lh:fix-storage-grpc-metadata-limit
Draft

span-lh wants to merge 1 commit into
googleapis:mainfrom
span-lh:fix-storage-grpc-metadata-limit

Conversation

@span-lh

@span-lh span-lh commented Oct 19, 2026

Copy link
Copy Markdown

Why

The gRPC Storage client currently inherits gRPC's 8 KiB inbound metadata limit. Larger response headers can fail with INTERNAL: http2 exception and Header size exceeded max allowed size (10240). For appendable uploads, losing the first acknowledgement can also leave a retry using the original generation condition after the server has already created a new generation.

Change

Set a bounded 64 KiB inbound metadata limit on the Storage client's GAX channel provider. Add real-transport regression tests covering small response metadata, an 18,000-byte response header, and rejection of a 96 KiB response header. Generation conditions, request retries, and upload behavior are unchanged.

Validation

  • Regression test failed with the exact 10,240-byte header error before the change and passes afterward.
  • mvn -f java-storage/google-cloud-storage/pom.xml -DskipITs test: 1,377 tests, zero failures/errors.
  • mvn -f java-storage/google-cloud-storage/pom.xml com.spotify.fmt:fmt-maven-plugin:check: passed with JDK 21.
  • Separately reproduced the appendable-upload header-rejection/precondition sequence with Storage 2.75.0 against a synthetic loopback GCS service; the same upload completes with the larger metadata limit.

Scope and limitations

The default changes for gRPC Storage clients only; response metadata remains bounded. The larger cap increases the worst-case accepted metadata size. Cloud-backed integration tests were not run. CodeScene could not run because the local CLI is not authenticated. This draft does not change a downstream application's dependencies or deploy a client.

Co-Authored-By: Codex (GPT-5) noreply@openai.com

Allow bounded response metadata larger than gRPC's default budget so an
otherwise valid Storage response does not fail during header decoding.
Cover accepted metadata and rejection above the new limit using loopback
gRPC transport tests.

Co-Authored-By: Codex (GPT-5) <noreply@openai.com>
@google-cla

google-cla Bot commented Oct 19, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request configures the maximum inbound metadata size for the gRPC channel provider to 64 KB in GrpcStorageOptions and introduces a new test suite, GrpcResponseMetadataTest, to verify that metadata sizes up to this limit are accepted while larger sizes are rejected. There are no review comments, and I have no feedback to provide.

This branch has not been deployed

No deployments
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.

1 participant