Skip to content

Conversation

sagikazarmark
Copy link

No description provided.

Signed-off-by: Mark Sagi-Kazar <[email protected]>
Clock: backoff.SystemClock,
}
b.Reset()

Copy link
Author

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.

@sagikazarmark
Copy link
Author

@microsoft-github-policy-service agree

@cgillum cgillum requested a review from Copilot September 17, 2025 21:52
Copy link

@Copilot Copilot AI left a 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 to github.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
Copy link

Copilot AI Sep 17, 2025

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.

Suggested change
b.MaxInterval = 15 * time.Second
b.MaxInterval = 15 * time.Second
b.MaxElapsedTime = 0 // infinite retries

Copilot uses AI. Check for mistakes.

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant