Skip to content

Conversation

@coryan
Copy link
Collaborator

@coryan coryan commented Jun 18, 2025

Fixes #2432

@coryan coryan marked this pull request as ready for review June 18, 2025 20:19
@coryan coryan requested a review from a team as a code owner June 18, 2025 20:19
Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

Returning LoopState

Pros:

  • applications do not need to learn a new type

Cons:

  • permanent should never happen, and could be disallowed

I am not opposed to returning this type but wanted to call this out. Thoughts?

@codecov
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.51%. Comparing base (26e9a46) to head (e8546d5).
Report is 34 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2456      +/-   ##
==========================================
+ Coverage   95.39%   95.51%   +0.12%     
==========================================
  Files          77       79       +2     
  Lines        3060     3168     +108     
==========================================
+ Hits         2919     3026     +107     
- Misses        141      142       +1     

☔ 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.

dbolduc
dbolduc previously approved these changes Jun 23, 2025
Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

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

I feel like attempt_count does not tell us enough, when throttles don't increase attempts.

But I also remember that the interface is hidden, and not public. This PR is about preserving the last error, which it does. So approved and we can nit about the interface later.

Copy link
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

Comment on lines +590 to +593
// The retry loop only calls `on_throttle()` if the policy has not
// been exhausted.
assert!(attempt_count < self.maximum_attempts);
self.inner.on_throttle(loop_start, attempt_count, error)
Copy link
Member

Choose a reason for hiding this comment

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

👍

@coryan coryan merged commit 148e24b into googleapis:main Jun 23, 2025
23 checks passed
@coryan coryan deleted the feat-gax-bang-preserve-retry-errors branch June 23, 2025 17:47
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.

Propagate previous error in on_throttle() callback

2 participants