Skip to content

feat(gax): retry policy decorator for 429 errors#4783

Merged
coryan merged 2 commits intogoogleapis:mainfrom
coryan:feat-gax-retry-policy-decorator-for-too-many-requests
Feb 27, 2026
Merged

feat(gax): retry policy decorator for 429 errors#4783
coryan merged 2 commits intogoogleapis:mainfrom
coryan:feat-gax-retry-policy-decorator-for-too-many-requests

Conversation

@coryan
Copy link
Copy Markdown
Collaborator

@coryan coryan commented Feb 23, 2026

Someday we will document how to use the RetryPolicy trait in applications and add your own policies. This may become duplicative (but still convenient) at that time.

Likewise, we may add a generic decorator that ignores specific HTTP status codes or gRPC status codes. But the API for that is unclear at the moment. If that happens this will still be convenient, but would duplicate some code.

At the moment, this seems like useful thing for customers to have. The most common case would be Aip194Strict.continue_on_too_many_requests().with_.... That is a reasonable policy for services that use ResourceExhausted to signal that a rate-based quota limit has been breached.

@coryan coryan added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Feb 23, 2026
@coryan coryan marked this pull request as ready for review February 23, 2026 23:49
@coryan coryan requested a review from a team as a code owner February 23, 2026 23:49
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.73%. Comparing base (e17822b) to head (2fec7f5).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4783      +/-   ##
==========================================
+ Coverage   94.72%   94.73%   +0.01%     
==========================================
  Files         205      206       +1     
  Lines        8115     8132      +17     
==========================================
+ Hits         7687     7704      +17     
  Misses        428      428              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coryan coryan force-pushed the feat-gax-retry-policy-decorator-for-too-many-requests branch from a04de27 to 374f43e Compare February 24, 2026 15:47
@coryan coryan removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Feb 27, 2026
@coryan coryan force-pushed the feat-gax-retry-policy-decorator-for-too-many-requests branch from 374f43e to ceffe3d Compare February 27, 2026 14:39
Copy link
Copy Markdown
Collaborator Author

@coryan coryan left a comment

Choose a reason for hiding this comment

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

PTAL, I think I fixed all the problems.

@coryan coryan enabled auto-merge (squash) February 27, 2026 15:50
@coryan coryan merged commit c6f5afd into googleapis:main Feb 27, 2026
35 checks passed
@coryan coryan deleted the feat-gax-retry-policy-decorator-for-too-many-requests branch February 27, 2026 16:11
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.

2 participants