Commit f155ccb
committed
refactor(retrypolicy): fix off-by-one in computeBackoff logging
retry-go's OnRetry callback supplies a 1-based retry attempt number,
so computeBackoff(n+1, ...) logged a delay that was one doubling
ahead of the actual backoff used by the retry loop. Pass n directly.
Also drop the unreachable attempt == 0 branch in computeBackoff
(retry-go never supplies 0) and skip that case in the test.
Addresses review feedback on PR #468 (gemini).
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>1 parent fcdbcb0 commit f155ccb
2 files changed
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
176 | 178 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 179 | | |
181 | 180 | | |
182 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
| 526 | + | |
| 527 | + | |
530 | 528 | | |
531 | 529 | | |
532 | 530 | | |
| |||
0 commit comments