Skip to content

feat(gax): add jitter knob to RetrySetting#442

Open
op wants to merge 1 commit into
yoshidan:mainfrom
op:op/retry-jitter
Open

feat(gax): add jitter knob to RetrySetting#442
op wants to merge 1 commit into
yoshidan:mainfrom
op:op/retry-jitter

Conversation

@op

@op op commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Add a jitter knob to RetrySetting but keep it disabled by default.

Add a jitter knob to RetrySetting but keep it disabled by default.

Copilot AI left a comment

Copy link
Copy Markdown

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 adds an optional “jitter” control to the gcloud-gax retry behavior, while keeping jitter disabled in all default retry settings across clients.

Changes:

  • Extend foundation/gax::RetrySetting with a jitter: bool knob (defaulting to false).
  • Apply tokio-retry2’s strategy::jitter to retry delays when the knob is enabled.
  • Update service-specific default retry settings to explicitly set jitter: false.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spanner/src/apiv1/spanner_client.rs Adds jitter: false to the client’s default RetrySetting literal.
spanner/src/admin/mod.rs Adds jitter: false to the admin default retry setting.
kms/src/grpc/apiv1/kms_client.rs Adds jitter: false to the KMS default RetrySetting literal.
foundation/longrunning/src/autogen/operations_client.rs Adds jitter: false to the longrunning operations default retry setting.
foundation/gax/src/retry.rs Introduces RetrySetting.jitter and applies jitter mapping to retry strategies when enabled.
foundation/gax/Cargo.toml Enables the tokio-retry2 jitter feature to support jittered backoff.
bigquery/src/grpc/apiv1/bigquery_client.rs Adds jitter: false to the BigQuery default RetrySetting literal.
artifact-registry/src/grpc/apiv1/artifact_registry_client.rs Adds jitter: false to the Artifact Registry default RetrySetting literal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread foundation/gax/src/retry.rs
Comment thread foundation/gax/Cargo.toml
Comment on lines 20 to +23
tower = { version = "0.5", features = ["filter", "util"] }
http = "1.1"
token-source = "1.0"
tokio-retry2 = "0.6"
tokio-retry2 = { version = "0.6", features = ["jitter"] }
@yoshidan yoshidan added the safe to test safe to test label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test safe to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants