Skip to content

feat(google_cloud_rpc): extract shared RetryRunner and ExponentialRetry - #352

Open
sigurdm wants to merge 2 commits into
mainfrom
rpc-retry
Open

sigurdm wants to merge 2 commits into
mainfrom
rpc-retry

Conversation

@sigurdm

@sigurdm sigurdm commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Extracts RetryRunner, ExponentialRetry (adding optional jitter), delaySequence (computing noRetriesAfter eagerly when delaySequence() is called), defaultRetry, NoDelayRetry, and ChecksumValidationException from package:google_cloud_storage into package:google_cloud_rpc/retry.dart.

  • package:google_cloud_storage re-exports package:google_cloud_rpc/retry.dart for backwards compatibility.
  • Moves pkgs/google_cloud_storage/test/retry_test.dart to generated/google_cloud_rpc/test/retry_test.dart.

Split out from #292 (1/4).
Closes #346

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request moves the retry classes (RetryRunner, ExponentialRetry) and ChecksumValidationException from google_cloud_storage to google_cloud_rpc while maintaining backwards compatibility through re-exports. It also adds corresponding unit tests and updates the librarian configuration. Regarding the feedback, using const constructors in the equality and hash code tests for ExponentialRetry can result in false positives due to Dart's canonicalization of constants; it is recommended to use final (non-const) instances instead to properly verify the equality implementation.

Comment thread generated/google_cloud_rpc/test/retry_test.dart
@kevmoo

kevmoo commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Filed #359 as a follow-up to wire RetryRunner and per-call RequestOptions into ServiceClient._makeRequest() and sidekick/dart once this lands.

@sigurdm
sigurdm added this pull request to stack #362 September 21, 2026 14:28
…ud_storage

TAG=agy
CONV=4ecd3490-bbbe-499e-90e5-07ea5e14a460
… to ExponentialRetry

TAG=agy
CONV=4ecd3490-bbbe-499e-90e5-07ea5e14a460
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.

Share retry logic between google_cloud_pubsub and google_cloud_storage (before pubsub 1.0)

2 participants