Skip to content

Commit

Permalink
fix: mixed retry
Browse files Browse the repository at this point in the history
  • Loading branch information
YangruiEmma committed Aug 27, 2024
1 parent 1db1bb7 commit ba33680
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/retry/mixed_retryer.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,15 @@ func (r *mixedRetryer) Do(ctx context.Context, rpcCall RPCCallFunc, firstRI rpci
continue
}
if callCount < retryTimes+1 {
if _, ok := r.ShouldRetry(ctx, nil, callCount, req, cbKey); ok {
if msg, ok := r.ShouldRetry(ctx, nil, callCount, req, cbKey); ok {
if r.isRetryResult(ctx, res.ri, res.resp, res.err, &r.policy.FailurePolicy) {
doCall = true
timer.Reset(retryDelay)
continue
}
} else if msg != "" {
appendMsg := fmt.Sprintf("retried %d, %s", callCount-1, msg)
appendErrMsg(res.err, appendMsg)
}
} else if r.isRetryResult(ctx, res.ri, res.resp, res.err, &r.policy.FailurePolicy) {
continue
Expand Down

0 comments on commit ba33680

Please sign in to comment.