Skip to content

feat(bootstrap): allow max_receive_message_length override on xDS gRPC service#9485

Open
linmosko wants to merge 3 commits into
envoyproxy:mainfrom
linmosko:feat/xds-grpc-max-receive-message-length
Open

feat(bootstrap): allow max_receive_message_length override on xDS gRPC service#9485
linmosko wants to merge 3 commits into
envoyproxy:mainfrom
linmosko:feat/xds-grpc-max-receive-message-length

Conversation

@linmosko

@linmosko linmosko commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Extends bootstrap validation to allow users to override max_receive_message_length on the xDS gRPC service.

Useful at scale when the xDS snapshot grows large - operators can tune the gRPC receive buffer via bootstrap override without triggering the dynamic_resources cannot be modified validation error.


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

@linmosko
linmosko requested a review from a team as a code owner July 13, 2026 20:29
@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 44b9350
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a58d43df1eb6900086b96f8
😎 Deploy Preview https://deploy-preview-9485--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 054d2a12e9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@@ -0,0 +1 @@
Added support for updating `max_receive_message_length` on the xDS gRPC service via bootstrap override, allowing operators to tune the gRPC receive buffer when the xDS snapshot grows large at scale.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a numeric release-note fragment filename

When make lint runs in CI, its lint.release-notes-filenames target invokes tools/hack/check-release-notes-filenames.sh, which requires current fragments to match ^[0-9]+-[a-z0-9-]+\.md$; this XXXXX-... placeholder filename fails that check and will block the lint job until it is renamed with a numeric PR/issue prefix.

Useful? React with 👍 / 👎.

@linmosko
linmosko force-pushed the feat/xds-grpc-max-receive-message-length branch from 1637ce8 to beefcc9 Compare July 13, 2026 20:37
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.41%. Comparing base (a16d887) to head (44b9350).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9485      +/-   ##
==========================================
- Coverage   75.43%   75.41%   -0.02%     
==========================================
  Files         252      252              
  Lines       41641    41642       +1     
==========================================
- Hits        31411    31405       -6     
- Misses       8098     8105       +7     
  Partials     2132     2132              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@guydc

guydc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

/retest

grpcServices:
- envoyGrpc:
clusterName: xds_cluster
maxReceiveMessageLength: 8388608

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.

Is there an equivalent parameter on the Envoy Gateway side that also needs tuning to allow sending large messages? I think grpc doesn't limit sent message sizes by default, but EG/go-control-plane may.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

internal/xds/runner/runner.go:212 uses grpc.NewServer() with no send size limit - Go gRPC default is unlimited for sends.

@@ -14,6 +14,7 @@ dynamicResources:
grpcServices:
- envoyGrpc:

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.

can you also add this to one of the in/out merge tests? Demonstrate that the merge is not block and it works as expected, patching the relevant fields.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, added

@linmosko
linmosko requested a review from guydc July 14, 2026 12:58
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

linmosko added 3 commits July 16, 2026 15:53
…C service

Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
…C service

Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
@linmosko
linmosko force-pushed the feat/xds-grpc-max-receive-message-length branch from 11c1acf to 44b9350 Compare July 16, 2026 12:53
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

@guydc guydc 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.

LGTM, thanks

Copilot AI 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.

Pull request overview

This PR extends Envoy Gateway’s bootstrap override validation so operators can set max_receive_message_length for the xDS gRPC service without tripping the “dynamic_resources cannot be modified” guard, enabling larger xDS snapshots to be delivered at scale.

Changes:

  • Allow dynamic_resources equality validation to ignore max_receive_message_length for the xDS gRPC Envoy gRPC service.
  • Add merge/JSONPatch test data and unit test coverage for applying this bootstrap override.
  • Add a release-note fragment documenting the new capability.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
release-notes/current/new_features/9485-xds-grpc-max-receive-message-length.md Documents the new bootstrap override capability for xDS gRPC receive message sizing.
internal/xds/bootstrap/validate.go Updates bootstrap validation to permit overriding max_receive_message_length for the xDS gRPC service.
internal/xds/bootstrap/util_test.go Adds a unit test case for patching max_receive_message_length into the rendered bootstrap.
internal/xds/bootstrap/testdata/validate/valid-user-bootstrap.yaml Updates “valid” user bootstrap sample to include the new field.
internal/xds/bootstrap/testdata/merge/merge-max-receive-message-length.{in,out}.yaml Adds JSONPatch input and expected bootstrap output for the new override behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arkodg

arkodg commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

should we just default to unlimited max_receive_message_length: 0 @guydc @zhaohuabing ?

@arkodg arkodg added this to the v1.9.0-rc.1 Release milestone Jul 19, 2026
@arkodg

arkodg commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

also https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/grpc_service.proto says it defaults to 0 ? so is this PR more about increase limits or reducing them ?

@zhaohuabing

zhaohuabing commented Jul 19, 2026

Copy link
Copy Markdown
Member

Useful at scale when the xDS snapshot grows large - operators can tune the gRPC receive buffer via bootstrap override without triggering the dynamic_resources cannot be modified validation error.

@linmosko Could you explain the use case here? You shouldn't need to tune the buffer, since the envoy default is 0 - unlimited, and EG didn't overried the default before.

@guydc

guydc commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I'm also not a sure if this parameter actually controls the envoy max receive message size. AI suggests that specifically for the xds stream, a custom grpc client is used, where this parameter is actually used to tune the decoder's HTTP2 maxFrameLength, with an unlimited default value.

I think that after some additional investigation, we assumed that an EG-side 4MB grpc message size limit was causing envoy ACKs/subscriptions to be rejected, when these envoy message had a very long list of resource names.

@linmosko - maybe we should change this PR to focus on exposing EG's XDS server message size settings?

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.

5 participants