Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions transport/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ func OpenShardConn(ctx context.Context, addr string, si ShardInfo, cfg ConnConfi
it := ShardPortIterator(si)
maxTries := (maxPort-minPort+1)/int(si.NrShards) + 1
for i := 0; i < maxTries; i++ {
if err := ctx.Err(); err != nil {
return nil, fmt.Errorf("aborted opening connection on shard %d: %w", si.Shard, err)
}

conn, err := OpenLocalPortConn(ctx, addr, it(), cfg)
if err != nil {
log.Printf("%s dial error: %s (try %d/%d)", addr, err, i, maxTries)
Expand Down