-
Notifications
You must be signed in to change notification settings - Fork 103
feat(gax)!: preserve retry loop errors #2456
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
feat(gax)!: preserve retry loop errors #2456
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.
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 ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
dbolduc
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.
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.
coryan
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.
PTAL
| // 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) |
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.
👍
Fixes #2432