@@ -29,6 +29,7 @@ import (
29
29
"github.com/cockroachdb/cockroach/pkg/util/retry"
30
30
"github.com/cockroachdb/errors"
31
31
"github.com/cockroachdb/redact"
32
+ "google.golang.org/grpc"
32
33
)
33
34
34
35
// TenantCluster represents the set of sql nodes running in a secondary tenant.
@@ -228,8 +229,19 @@ func (t *TenantCluster) ForEveryNodeOrServer(
228
229
grp .GoCtx (func (ctx context.Context ) error {
229
230
defer alloc .Release ()
230
231
231
- conn , err := t .Dialer .Dial (ctx , roachpb .NodeID (instance .InstanceID ), rpc .DefaultClass )
232
- if err != nil {
232
+ var conn * grpc.ClientConn
233
+ retryOpts := retry.Options {
234
+ InitialBackoff : 0 ,
235
+ MaxRetries : 2 ,
236
+ MaxBackoff : 10 * time .Millisecond ,
237
+ }
238
+ // This retry was added to benefit our tests (not users) by reducing the chance of
239
+ // test flakes due to network issues.
240
+ if err := retry .WithMaxAttempts (ctx , retryOpts , retryOpts .MaxRetries + 1 , func () error {
241
+ var err error
242
+ conn , err = t .Dialer .Dial (ctx , roachpb .NodeID (instance .InstanceID ), rpc .DefaultClass )
243
+ return err
244
+ }); err != nil {
233
245
if errors .HasType (err , (* netutil .InitialHeartbeatFailedError )(nil )) {
234
246
if errors .Is (err , rpc .VersionCompatError ) {
235
247
return errors .WithHint (errors .Newf ("upgrade failed due to active SQL servers with incompatible binary version(s)" ),
0 commit comments