Skip to content

Commit a0a22bd

Browse files
authored
Merge pull request moby#4015 from jedevc/buildctl-set-max-backoff
buildctl: set max backoff delay to 1 second
2 parents ca5d5bf + 1aef766 commit a0a22bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/buildctl/common/common.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import (
1616
"github.com/pkg/errors"
1717
"github.com/urfave/cli"
1818
"go.opentelemetry.io/otel/trace"
19+
"google.golang.org/grpc"
20+
"google.golang.org/grpc/backoff"
1921
)
2022

2123
// ResolveClient resolves a client from CLI args
@@ -67,6 +69,12 @@ func ResolveClient(c *cli.Context) (*client.Client, error) {
6769

6870
opts := []client.ClientOpt{client.WithFailFast()}
6971

72+
backoffConfig := backoff.DefaultConfig
73+
backoffConfig.MaxDelay = 1 * time.Second
74+
opts = append(opts, client.WithGRPCDialOption(
75+
grpc.WithConnectParams(grpc.ConnectParams{Backoff: backoffConfig}),
76+
))
77+
7078
ctx := CommandContext(c)
7179

7280
if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() {

0 commit comments

Comments
 (0)