chore(executor/sandbox): different default call options max size

This commit is contained in:
张泊明518370910136 2024-11-14 04:19:29 -05:00
parent d5857e15b5
commit 4b418600e3
GPG Key ID: D47306D7062CDA9D

View File

@ -25,8 +25,10 @@ func createGRPCConnection(addr, token string) (*grpc.ClientConn, error) {
// max size according to https://protobuf.dev/programming-guides/encoding/#size-limit
opts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
// different to distinguish the error of ResourceExhausted
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32), // 2 GB
grpc.MaxCallRecvMsgSize(math.MaxInt32-2), // 2 GB - 2, 2147483645
grpc.MaxCallSendMsgSize(math.MaxInt32-1), // 2 GB - 1, 2147483646
),
}
if token != "" {