Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/common/container_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ func (c *ContainerClient) connect() error {
}

maxMessageSize := 1 << 30 // 1Gi
dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(maxMessageSize),
grpc.MaxCallSendMsgSize(maxMessageSize),
))

if c.ServiceToken != "" {
dialOpts = append(dialOpts, grpc.WithUnaryInterceptor(GRPCClientAuthInterceptor(c.ServiceToken)),
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(maxMessageSize),
grpc.MaxCallSendMsgSize(maxMessageSize),
))
dialOpts = append(dialOpts, grpc.WithUnaryInterceptor(GRPCClientAuthInterceptor(c.ServiceToken)))
}

conn, err := grpc.Dial(c.ServiceUrl, dialOpts...)
Expand Down
8 changes: 7 additions & 1 deletion pkg/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,13 @@ func (g *Gateway) initGrpcProxy(grpcAddr string) error {
cancel()
})
mux := runtime.NewServeMux()
opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}
opts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(g.Config.GatewayService.GRPC.MaxRecvMsgSize*1024*1024),
grpc.MaxCallSendMsgSize(g.Config.GatewayService.GRPC.MaxSendMsgSize*1024*1024),
),
}
if err := pb.RegisterPodServiceHandlerFromEndpoint(ctx, mux, grpcAddr, opts); err != nil {
return err
}
Expand Down
5 changes: 4 additions & 1 deletion sdk/src/beta9/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ def handle_grpc_error(error: grpc.RpcError):
elif code == grpc.StatusCode.CANCELLED:
return
elif code == grpc.StatusCode.RESOURCE_EXHAUSTED:
terminal.error("Please ensure your payload or function arguments are less than 4 MiB.")
terminal.error(
f"Message size exceeds the gRPC limit. "
f"Please ensure your payload or function arguments are less than {GRPC_MAX_MESSAGE_SIZE // (1024 * 1024)} MiB."
)
elif code == grpc.StatusCode.UNKNOWN:
terminal.error(f"Error {details}")
else:
Expand Down
Loading