From adb9dd2a9a286249510744033cb372117a2d4a2d Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 6 Nov 2024 07:20:05 -0500 Subject: [PATCH] feat(executor): default 512 MB grpc msg size --- internal/executor/sandbox/executor.go | 2 +- internal/executor/sandbox/grpc.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/executor/sandbox/executor.go b/internal/executor/sandbox/executor.go index 7a3a63f..746717b 100644 --- a/internal/executor/sandbox/executor.go +++ b/internal/executor/sandbox/executor.go @@ -59,7 +59,7 @@ func (e *Sandbox) Run(cmds []stage.Cmd) ([]stage.ExecutorResult, error) { ) } } - slog.Debug("sandbox execute", "total protobuf cmd size", totalPbCmdSize) + slog.Info("sandbox execute", "total protobuf cmd size", totalPbCmdSize) pbReq := &pb.Request{Cmd: pbCmds} pbRet, err := e.execClient.Exec(context.TODO(), pbReq) if err != nil { diff --git a/internal/executor/sandbox/grpc.go b/internal/executor/sandbox/grpc.go index 6bb75c3..09ac7ef 100644 --- a/internal/executor/sandbox/grpc.go +++ b/internal/executor/sandbox/grpc.go @@ -23,6 +23,9 @@ func createExecClient(execServer, token string) (pb.ExecutorClient, error) { func createGRPCConnection(addr, token string) (*grpc.ClientConn, error) { opts := []grpc.DialOption{ grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(512 * 1024 * 1024), // 512 MB + ), } if token != "" { opts = append(opts, grpc.WithPerRPCCredentials(newTokenAuth(token)))