-
Notifications
You must be signed in to change notification settings - Fork 318
Enable configuring retryable status codes #3243
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
Conversation
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 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 theRetryPolicytrait - Implements configurable status codes in both
FixedRetryPolicyandExponentialRetryPolicy - 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 |
heaths
left a comment
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.
Given your description, I don't think this is the right place to define these.
5141cbc to
06118a8
Compare
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
I guess this feature won't often be used, however I know a couple uses of it with the Go SDK and
azure_identityneeds either this or a custom retry policy to implement correct behavior for IMDS.