authzed / zed

Official command-line tool for managing SpiceDB
https://authzed.com/docs/reference/clients
Apache License 2.0
118 stars 26 forks source link

Add option for max message size #407

Closed tstirrat15 closed 2 months ago

tstirrat15 commented 2 months ago

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