chore(executor/sandbox): different default call options max size
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 1m22s
build / trigger-build-image (push) Successful in 7s

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 // max size according to https://protobuf.dev/programming-guides/encoding/#size-limit
opts := []grpc.DialOption{ opts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithTransportCredentials(insecure.NewCredentials()),
// different to distinguish the error of ResourceExhausted
grpc.WithDefaultCallOptions( 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 != "" { if token != "" {