From 77b5f2f5c2823c3fa3f1dce74d3dac0e27e10522 Mon Sep 17 00:00:00 2001 From: jyjiangkai Date: Mon, 9 Oct 2023 11:50:53 +0800 Subject: [PATCH] feat: add grpc recv msg size (#635) Signed-off-by: jyjiangkai --- client/internal/net/connection/connect.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/internal/net/connection/connect.go b/client/internal/net/connection/connect.go index c9406fc32..a5dd12121 100644 --- a/client/internal/net/connection/connect.go +++ b/client/internal/net/connection/connect.go @@ -27,6 +27,10 @@ import ( errinterceptor "github.com/vanus-labs/vanus/api/grpc/interceptor/errors" ) +const ( + maxRecvMsgSize = 30 * 1024 * 1024 +) + func Connect(ctx context.Context, endpoint string) (*grpc.ClientConn, error) { opts := []grpc.DialOption{ grpc.WithBlock(), @@ -34,6 +38,7 @@ func Connect(ctx context.Context, endpoint string) (*grpc.ClientConn, error) { grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()), grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()), grpc.WithUnaryInterceptor(errinterceptor.UnaryClientInterceptor()), + grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxRecvMsgSize)), } conn, err := grpc.DialContext(ctx, endpoint, opts...) if err != nil {