Skip to content

feat(xds): add configurable max receive message size for xDS gRPC server#9564

Open
linmosko wants to merge 4 commits into
envoyproxy:mainfrom
linmosko:feat/xds-grpc-max-recv-msg-size
Open

feat(xds): add configurable max receive message size for xDS gRPC server#9564
linmosko wants to merge 4 commits into
envoyproxy:mainfrom
linmosko:feat/xds-grpc-max-recv-msg-size

Conversation

@linmosko

@linmosko linmosko commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Adds xdsServer.maxRecvMsgSize to the EnvoyGateway API, allowing to increase the maximum message size the xDS gRPC server will accept from Envoy proxy.

At scale, when the xDS snapshot grows large (e.g. tens of thousands of
clusters/listeners), the default 4MiB gRPC receive limit is exceeded, causing the xDS stream to fail with:

grpc: received message larger than max (4236915 vs. 4194304)


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.

Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
@linmosko
linmosko requested a review from a team as a code owner July 22, 2026 21:04
@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 3eabc24
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a6227c140d2d400088a516f
😎 Deploy Preview https://deploy-preview-9564--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.

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

@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: a2ef866102

ℹ️ 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".


if r.EnvoyGateway.XDSServer != nil && r.EnvoyGateway.XDSServer.MaxRecvMsgSize != nil {
maxRecvMsgSize, _ := r.EnvoyGateway.XDSServer.MaxRecvMsgSize.AsInt64()
baseKeepaliveOptions = append(baseKeepaliveOptions, grpc.MaxRecvMsgSize(int(maxRecvMsgSize)))

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 Configure the Envoy receive limit for large snapshots

For the documented scale case where the xDS snapshot/DiscoveryResponse is over 4MiB, Envoy Gateway is the sender and the Envoy proxy is the receiver; grpc.MaxRecvMsgSize here only raises the Go server's inbound DiscoveryRequest limit. Setting xdsServer.maxRecvMsgSize therefore leaves the advertised received message larger than max failure on Envoy's receive path unchanged, so large snapshots will still fail unless the Envoy bootstrap/client receive limit is configured instead.

Useful? React with 👍 / 👎.

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.

DeltaDiscoveryRequest.resource_names_subscribe and DeltaDiscoveryRequest.initial_resource_versions from the XDS Client may grow large when the snapshot contains many resources. This is the concern addressed here. WDYT @codex ?

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: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 4f97097f92

ℹ️ 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".

@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.59%. Comparing base (14d5ba7) to head (3eabc24).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9564      +/-   ##
==========================================
+ Coverage   75.58%   75.59%   +0.01%     
==========================================
  Files         252      252              
  Lines       41743    41755      +12     
==========================================
+ Hits        31550    31564      +14     
+ Misses       8065     8064       -1     
+ Partials     2128     2127       -1     

☔ 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.

linmosko added 2 commits July 23, 2026 13:52
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
@linmosko
linmosko requested a review from guydc July 23, 2026 14:40
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

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.

2 participants