Skip to content

feat(xds): raise xDS gRPC server default receive limit and make it configurable - #9564

Merged
guydc merged 13 commits into
envoyproxy:mainfrom
linmosko:feat/xds-grpc-max-recv-msg-size
Jul 28, 2026
Merged

feat(xds): raise xDS gRPC server default receive limit and make it configurable#9564
guydc merged 13 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

Raises the xDS gRPC server's default receive limit from 4MiB to 32MiB,
and adds xdsServer.maxReceiveMessageSize to the EnvoyGateway API, allowing to raise the xDS gRPC server's receive limit.

At large resource counts, an Envoy proxy's delta xDS request on stream reconnect
echoes back the name and version of every resource it holds. This request can exceed
the 4MiB gRPC default, breaking the stream immediately with:

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

This leaves the proxy stuck on its last known-good configuration. Setting
maxReceiveMessageSize in the EnvoyGateway config resolves this.

Note: this limit applies only to what Envoy Gateway receives; the configuration
it sends to Envoy is not bounded by it.


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 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 d5de40f
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a687b1b1c4e72000952b686
😎 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.

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

Comment thread internal/xds/runner/runner.go Outdated

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.67%. Comparing base (bb7cdd1) to head (d5de40f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9564   +/-   ##
=======================================
  Coverage   75.67%   75.67%           
=======================================
  Files         254      254           
  Lines       41933    41942    +9     
=======================================
+ Hits        31731    31740    +9     
- Misses       8071     8072    +1     
+ Partials     2131     2130    -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
linmosko requested a review from guydc July 23, 2026 14:40
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread api/v1alpha1/envoygateway_types.go Outdated
// If unspecified, the default gRPC receive limit applies (4MiB).
//
// +optional
MaxRecvMsgSize *resource.Quantity `json:"maxRecvMsgSize,omitempty"`

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.

nit: in extension manager we use MaxMessageSize, so maybe MaxReceiveMessageSize

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.

Changed, thanks.

@linmosko
linmosko force-pushed the feat/xds-grpc-max-recv-msg-size branch from 494fa76 to 054fa05 Compare July 24, 2026 08:27
@linmosko
linmosko requested a review from guydc July 24, 2026 08:28
guydc
guydc previously approved these changes Jul 24, 2026

@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!

@guydc

guydc commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

cc @zhaohuabing @arkodg - in case of very large snapshots, EG can reject XDS subscribe messages.

@zhaohuabing

Copy link
Copy Markdown
Member

@linmosko could you please modify the the PR description? It's the xDS request from the Envoy to EG that caused the issue, not the snapshot.

Comment thread api/v1alpha1/envoygateway_types.go Outdated
@@ -0,0 +1 @@
Added `xdsServer.maxReceiveMessageSize` field to the EnvoyGateway API, allowing operators to increase the xDS gRPC server's maximum receive message size when large xDS snapshots at scale exceed the default 4MiB limit, which previously caused "received message larger than max" stream errors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Added `xdsServer.maxReceiveMessageSize` field to the EnvoyGateway API, allowing operators to increase the xDS gRPC server's maximum receive message size when large xDS snapshots at scale exceed the default 4MiB limit, which previously caused "received message larger than max" stream errors.
Added `xdsServer.maxReceiveMessageSize` to the EnvoyGateway API, allowing operators to raise the xDS gRPC server's receive limit. At large resource counts, an Envoy proxy's delta xDS request on stream reconnect can exceed the 4MiB gRPC default, which previously broke the stream with "received message larger than max" errors and left the proxy on its last known-good configuration.

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.

Changed, thanks

linmosko added 6 commits July 26, 2026 08:38
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
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-recv-msg-size branch from 93f4915 to ef7fcbe Compare July 26, 2026 05:38
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

@arkodg arkodg added this to the v1.9.0-rc.1 Release milestone Jul 26, 2026
Comment thread api/v1alpha1/envoygateway_types.go Outdated
Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
@linmosko linmosko changed the title feat(xds): add configurable max receive message size for xDS gRPC server feat(xds): raise xDS gRPC server default receive limit and make it configurable Jul 27, 2026
@linmosko
linmosko requested a review from arkodg July 27, 2026 10:52
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

@zhaohuabing zhaohuabing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks!

@linmosko

Copy link
Copy Markdown
Contributor Author

Hi @zhaohuabing !
Is there a known issue with the Hugo Docs action?

@guydc

guydc commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

/retest

2 similar comments
@linmosko

Copy link
Copy Markdown
Contributor Author

/retest

@guydc

guydc commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

/retest

@guydc
guydc merged commit 8e32174 into envoyproxy:main Jul 28, 2026
114 of 124 checks passed
@linmosko
linmosko deleted the feat/xds-grpc-max-recv-msg-size branch July 28, 2026 15:54
HusseinKabbout pushed a commit to HusseinKabbout/gateway that referenced this pull request Jul 30, 2026
…nfigurable (envoyproxy#9564)

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

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

* update release notes

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

* test(xds): add coverage for MaxRecvMsgSize runner option

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

* lint

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

* refactor: rename MaxRecvMsgSize to MaxReceiveMessageSize for consistency

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

* docs: improve MaxReceiveMessageSize comment and release note

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

* feat(xds): set default max receive message size to 32MiB

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

---------

Signed-off-by: Lin Moskovitch <lin.moskovitch@sap.com>
Co-authored-by: Guy Daich <guy.daich@sap.com>
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.

4 participants