Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for max message size #407

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Add option for max message size #407

merged 4 commits into from
Aug 28, 2024

Conversation

tstirrat15
Copy link
Contributor

@tstirrat15 tstirrat15 commented Aug 28, 2024

Description

We had a user run into an issue where zed backup <filename> failed with:

2:08PM ERR terminated with errors error="error receiving relationships: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (6280392 vs. 4194304)"

This indicates that the client received a 6mb message with a max configured message size of 4mb, which is the default for a gRPC client.

This seems like something that could reasonably happen with a sufficiently large schema, especially if it has lots of comments.

My understanding is that this is a securityish feature meant to prevent a client from choking on an incoming message. It would also prevent a client from getting OOMkilled as a result of attempting to read a too-large message into memory. For the zed client, it seems like this isn't a concern, since it would typically be running on either a user's device or a CI server, neither of which are particularly memory-constrained.

Changes

  • Add a command line flag for dial opts that increase the max message size for both send and receive

Testing

Review. See that tests still pass.

@tstirrat15 tstirrat15 changed the title Up max message size Add option for max message size Aug 28, 2024
@tstirrat15 tstirrat15 self-assigned this Aug 28, 2024
Copy link
Member

@josephschorr josephschorr left a comment

Choose a reason for hiding this comment

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

LGTM

@tstirrat15 tstirrat15 merged commit 06bfef4 into main Aug 28, 2024
15 checks passed
@tstirrat15 tstirrat15 deleted the up-max-message-size-limit branch August 28, 2024 20:04
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants