Skip to content

Commit 1ad553d

Browse files
authored
Backup: Fix excessive retry delays caused by context errors (#59951)
ref #53835
1 parent 424bb34 commit 1ad553d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

br/pkg/backup/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,9 @@ func (bc *Client) findTargetPeer(ctx context.Context, key []byte, isRawKv bool,
10551055
// in order to find the correct region.
10561056
key = codec.EncodeBytesExt([]byte{}, key, isRawKv)
10571057
for i := 1; i < 100; i++ {
1058+
if ctx.Err() != nil {
1059+
return nil, ctx.Err()
1060+
}
10581061
// better backoff.
10591062
region, err := bc.mgr.GetPDClient().GetRegion(ctx, key)
10601063
if err != nil || region == nil {

0 commit comments

Comments
 (0)