How do I fix client errors saying "Received message larger than max"?

I have a client query that gives an error Received message larger than max. How can I fix this?

gRPC is a default maximum message size of 4MB. Attempting to send messages larger than this will result in an error. To fix this, you should either:

  • Reduce message sizes by breaking them into smaller chunks.
  • Increase the maximum message size on both the client and server.

For the latter, refer to Grpc_arg_keys for available options. The relevant keys are:

  • GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH
  • GRPC_ARG_MAX_SEND_MESSAGE_LENGTH

For the Python client, you can set these options when constructing the session via the client_opts parameter:

import pydeephaven

session = pydeephaven.Session(
    host="localhost",
    port=10000,
    client_opts=[
        ("grpc.max_receive_message_length", 10 * 1024 * 1024),  # 10 MB
        ("grpc.max_send_message_length", 10 * 1024 * 1024),  # 10 MB
    ],
)

Note

These FAQ pages contain answers to questions about Deephaven Community Core that our users have asked in our Community Slack. If you have a question that is not in our documentation, join our Community and we'll be happy to help!