Skip to content

Commit

Permalink
Increase max message size (#1777)
Browse files Browse the repository at this point in the history
Generating debug metadata for large apps fails due to default gRPC
message size limits:

```
git:(main) encore debug meta --format json
error: grpc: received message larger than max (6181042 vs. 4194304)
```

This increases the limit from 4mb to 16mb.
  • Loading branch information
Willyham authored Feb 27, 2025
1 parent fd21ae2 commit 8b396c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/cmd/encore/cmdutil/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,14 @@ func dialDaemon(ctx context.Context, socketPath string) (*grpc.ClientConn, error
dialer := func(ctx context.Context, addr string) (net.Conn, error) {
return (&net.Dialer{}).DialContext(ctx, "unix", socketPath)
}
// Set max message size to 16mb (up from default 4mb) for json formatted debug metadata for large applications.
return grpc.DialContext(ctx, "",
grpc.WithInsecure(),
grpc.WithBlock(),
grpc.WithUnaryInterceptor(errInterceptor),
grpc.WithContextDialer(dialer))
grpc.WithContextDialer(dialer),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(16*1024*1024)),
)
}

func errInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
Expand Down

0 comments on commit 8b396c6

Please sign in to comment.