Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit ce4b4e9

Browse files
backoff increase
1 parent e6139cd commit ce4b4e9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/provisioner/provisioner.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package provisioner
1717

1818
import (
1919
"context"
20+
"google.golang.org/grpc/backoff"
2021
"net/url"
2122
"time"
2223

@@ -28,16 +29,22 @@ import (
2829
)
2930

3031
const (
31-
maxGrpcBackoff = 30 * time.Second
32+
maxGrpcBackoff = 5 * 30 * time.Second
3233
grpcDialTimeout = 30 * time.Second
3334
)
3435

3536
func NewDefaultCOSIProvisionerClient(ctx context.Context, address string, debug bool) (*COSIProvisionerClient, error) {
37+
backoffConfiguration := backoff.DefaultConfig
38+
backoffConfiguration.MaxDelay = maxGrpcBackoff
39+
backoffConfiguration.BaseDelay = grpcDialTimeout
40+
3641
dialOpts := []grpc.DialOption{
3742
grpc.WithInsecure(), // strictly restricting to local Unix domain socket
38-
grpc.WithBackoffMaxDelay(maxGrpcBackoff),
43+
grpc.WithConnectParams(grpc.ConnectParams{
44+
Backoff: backoffConfiguration,
45+
MinConnectTimeout: grpcDialTimeout,
46+
}),
3947
grpc.WithBlock(), // block until connection succeeds
40-
grpc.WithTimeout(grpcDialTimeout),
4148
}
4249

4350
interceptors := []grpc.UnaryClientInterceptor{}

0 commit comments

Comments
 (0)