Conversation
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
| Clock: backoff.SystemClock, | ||
| } | ||
| b.Reset() | ||
|
|
There was a problem hiding this comment.
Seems to me this could be rewriten to use backoff.Retry as well.
The only difference: the backoff library doesn't start by waiting for a tick.
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the backoff library from v4 to v5, adapting the codebase to use the new generic-based API introduced in v5.
- Updates dependency from
github.com/cenkalti/backoff/v4togithub.com/cenkalti/backoff/v5 - Migrates retry functions to use the new generic
backoff.Retry[T]signature - Removes deprecated configuration fields that are no longer needed in v5
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updates backoff dependency from v4.1.3 to v5.0.3 |
| client/worker_grpc.go | Migrates retry logic to v5 generic API and removes deprecated MaxElapsedTime setting |
| client/client_grpc.go | Updates retry calls to use new generic signature and context handling |
| backend/worker.go | Removes deprecated Stop and Clock fields from backoff configuration |
| backend/executor.go | Removes deprecated Stop and Clock fields from backoff configuration |
| backend/client.go | Removes deprecated Stop and Clock fields from backoff configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -205,8 +205,6 @@ func newInfiniteRetries() *backoff.ExponentialBackOff { | |||
| b := backoff.NewExponentialBackOff() | |||
| // max wait of 15 seconds between retries | |||
| b.MaxInterval = 15 * time.Second | |||
There was a problem hiding this comment.
The removal of b.MaxElapsedTime = 0 breaks the infinite retry behavior. In backoff v5, the default MaxElapsedTime is 15 minutes, so retries will stop after that duration. You need to set b.MaxElapsedTime = 0 to maintain infinite retries as indicated by the function name and comment.
| b.MaxInterval = 15 * time.Second | |
| b.MaxInterval = 15 * time.Second | |
| b.MaxElapsedTime = 0 // infinite retries |
There was a problem hiding this comment.
No, this has been moved to Retry. There is no max elapsed time tracking in the backoff setting anymore.
No description provided.