dapr / dapr/js-sdk

gRPC client: maxBodySizeMb sets only send limit; receive limit stays at 4MB

Open
#735 6 comments 0 reactions 1 assignee Claimed by @Siraddeen View on GitHub
area/service-invocation bug
Dominant language
JavaScript
Stars
217
Forks
104
PR merge metrics
No merged PRs in 30d

Description

# gRPC client: maxBodySizeMb sets only send limit; receive limit stays at 4MB

## Expected Behavior

When the Dapr JS/TS client is configured for gRPC with a larger message size (e.g. `maxBodySizeMb`), both **send** and **receive** gRPC message size limits are set to that value. Requests and responses can exceed the default 4MB up to the configured limit.

## Actual Behavior

Only the send limit (`grpc.max_send_message_length`) is set from the configured body size. The receive limit (`grpc.max_receive_message_length`) is never set, so it remains at the gRPC default (4MB). When the server returns a response larger than 4MB, the client fails with:

```
RESOURCE_EXHAUSTED: Received message larger than max (XXXXX vs 4194304)
```

even though a larger body size was configured.

## Steps to Reproduce the Problem

1. Create a Dapr client with gRPC and a body size > 4MB (e.g. `maxBodySizeMb: 10` or equivalent in `DaprClient`/`GRPCClient` options).
2. Invoke an app method that returns a payload larger than 4MB (e.g. a service that echoes a large request body).
3. Observe that the request is sent successfully but the client throws `RESOURCE_EXHAUSTED: Received message larger than max (... vs 4194304)` when reading the response.

**Root cause:** In `GRPCClient`, the code that builds gRPC channel options (e.g. `generateChannelOptions()`) sets `grpc.max_send_message_length` from the configured body size but does not set `grpc.max_receive_message_length`. **Suggested fix:** Set `grpc.max_receive_message_length` to the same value wherever `grpc.max_send_message_length` is set.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.