Skip to content

Conversation

@chlowell
Copy link
Member

@chlowell chlowell commented Oct 20, 2025

I guess this feature won't often be used, however I know a couple uses of it with the Go SDK and azure_identity needs either this or a custom retry policy to implement correct behavior for IMDS.

@chlowell chlowell self-assigned this Oct 20, 2025
@github-actions github-actions bot added the Azure.Core The azure_core crate label Oct 20, 2025
@chlowell chlowell marked this pull request as ready for review October 23, 2025 18:48
Copilot AI review requested due to automatic review settings October 23, 2025 18:48
Copy link
Contributor

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 adds the ability to configure which HTTP status codes should trigger retries in the retry policy. Previously, retries were attempted for a fixed set of status codes. Now, users can customize this list through a new with_retry_statuses() builder method on RetryOptions.

Key changes:

  • Adds a new get_retry_status_codes() method to the RetryPolicy trait
  • Implements configurable status codes in both FixedRetryPolicy and ExponentialRetryPolicy
  • Provides a fluent builder API through RetryOptions::with_retry_statuses()

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/core/typespec_client_core/src/http/policies/retry/mod.rs Adds get_retry_status_codes() to RetryPolicy trait, renames constant to DEFAULT_RETRY_STATUSES, updates retry logic, adds comprehensive tests
sdk/core/typespec_client_core/src/http/policies/retry/fixed.rs Implements configurable status codes in FixedRetryPolicy with new field and getter method
sdk/core/typespec_client_core/src/http/policies/retry/exponential.rs Implements configurable status codes in ExponentialRetryPolicy with new field and getter method
sdk/core/typespec_client_core/src/http/options/retry.rs Adds with_retry_statuses() builder method and status_codes field to RetryOptions
sdk/core/typespec_client_core/CHANGELOG.md Documents the new feature in the changelog

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

Given your description, I don't think this is the right place to define these.

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

typespec_client_core
azure_core

@chlowell chlowell requested a review from heaths October 30, 2025 22:09
@chlowell chlowell requested a review from heaths November 4, 2025 00:17
@chlowell chlowell enabled auto-merge (squash) November 4, 2025 16:06
@chlowell chlowell merged commit 8a151d3 into Azure:main Nov 4, 2025
17 checks passed
@chlowell chlowell deleted the retry-status-codes branch November 4, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core The azure_core crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants