-
Notifications
You must be signed in to change notification settings - Fork 52
Upgrade backoff library to v5 #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mark Sagi-Kazar <[email protected]>
Clock: backoff.SystemClock, | ||
} | ||
b.Reset() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/v4
togithub.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.
func newInfiniteRetries() *backoff.ExponentialBackOff { | ||
b := backoff.NewExponentialBackOff() | ||
// max wait of 15 seconds between retries | ||
b.MaxInterval = 15 * time.Second |
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this has been moved to Retry. There is no max elapsed time tracking in the backoff setting anymore.
No description provided.