chore: reduce the default gRPC connection timeout to proxied machines 20->10s

This commit is contained in:
Pasha Sviderski
2025-12-23 19:48:57 +10:00
parent f6cf73190f
commit f86e63c851
+3 -1
View File
@@ -80,6 +80,8 @@ func (b *RemoteBackend) GetConnection(ctx context.Context, _ string) (context.Co
backoffConfig.MaxDelay = 15 * time.Second backoffConfig.MaxDelay = 15 * time.Second
var err error var err error
// This client keeps retrying connection in the background indefinitely even after the first connection fails
// and the Unavailable error is returned to the caller.
b.conn, err = grpc.NewClient( b.conn, err = grpc.NewClient(
b.target, b.target,
grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithTransportCredentials(insecure.NewCredentials()),
@@ -88,7 +90,7 @@ func (b *RemoteBackend) GetConnection(ctx context.Context, _ string) (context.Co
// Not published as a constant in gRPC library. // Not published as a constant in gRPC library.
// See: https://github.com/grpc/grpc-go/blob/d5dee5fdbdeb52f6ea10b37b2cc7ce37814642d7/clientconn.go#L55-L56 // See: https://github.com/grpc/grpc-go/blob/d5dee5fdbdeb52f6ea10b37b2cc7ce37814642d7/clientconn.go#L55-L56
// Each connection attempt can take up to MinConnectTimeout. // Each connection attempt can take up to MinConnectTimeout.
MinConnectTimeout: 20 * time.Second, MinConnectTimeout: 10 * time.Second,
}), }),
grpc.WithDefaultCallOptions( grpc.WithDefaultCallOptions(
grpc.ForceCodecV2(proxy.Codec()), grpc.ForceCodecV2(proxy.Codec()),