Skip to content

feat(services): retry HTTP 429 responses - #8035

Merged
erickguan merged 1 commit into
apache:mainfrom
ddupg:feat/retry-http-429
Aug 7, 2026
Merged

feat(services): retry HTTP 429 responses#8035
erickguan merged 1 commit into
apache:mainfrom
ddupg:feat/retry-http-429

Conversation

@ddupg

@ddupg ddupg commented Aug 7, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A. This is a small consistency improvement across service error parsers.

Rationale for this change

RetryLayer retries only errors marked as temporary. Azure Blob, Azure Data Lake Storage, OSS, and Hugging Face currently classify HTTP 429 responses as persistent Unexpected errors, so RetryLayer does not retry them.

The retry behavior is supported by the providers' official SDKs or documentation:

  • Azure SDK lists HTTP 429 among the default retryable status codes and demonstrates the retry policy with BlobClientOptions. Azure Data Lake clients inherit the Azure Core retry options: Azure SDK retry policy and DataLakeClientOptions.
  • Alibaba Cloud OSS Go SDK v2 explicitly includes 429 // Rate exceeded in its retryable error codes: retryable_error.go.
  • Hugging Face Hub documents that rate limit violations return HTTP 429 and that official clients handle retries using the reset value: Hub rate limits.

This PR intentionally leaves Tencent COS unchanged. The official COS documentation describes QPS limits and flow control but does not document that they return HTTP 429, and the official Go SDK retry tests cover 500, 503, and 504 but not 429: COS request rate limits and COS Go SDK retry tests.

What changes are included in this PR?

  • Classify HTTP 429 as temporary ErrorKind::RateLimited in the Azure Blob, Azure Data Lake Storage, OSS, and Hugging Face error parsers.
  • Keep retry policy, backoff, and Retry-After handling unchanged.

Validation:

  • cargo fmt --all -- --check
  • Focused clippy for the four service packages with -D warnings
  • Existing unit tests for the four service packages: 82 passed, 4 ignored

Are there any user-facing changes?

Yes. When users wrap these services with RetryLayer, HTTP 429 responses now enter the configured retry flow. There are no public API changes.

AI Usage Statement

OpenAI Codex (GPT-5) was used to investigate provider retry behavior, implement the change, and run validation.

@ddupg
ddupg marked this pull request as ready for review August 7, 2026 09:55
@ddupg
ddupg requested a review from Xuanwo as a code owner August 7, 2026 09:55
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Aug 7, 2026
@erickguan
erickguan self-requested a review August 7, 2026 13:22

@erickguan erickguan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Great improvement!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 7, 2026
@erickguan
erickguan merged commit f4c6cda into apache:main Aug 7, 2026
104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants