-
Notifications
You must be signed in to change notification settings - Fork 104
WIP: change timeout-backoff to logical call timeout #1152
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1152 +/- ##
=========================================
Coverage 79.07% 79.08%
Complexity 1193 1193
=========================================
Files 205 205
Lines 5258 5259 +1
Branches 433 433
=========================================
+ Hits 4158 4159 +1
Misses 929 929
Partials 171 171
Continue to review full report at Codecov.
|
miraleung
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.
Not enough context to confirm / approve, but I'd recommend adding some comments near the changed areas so that future readers understand what the algorithm is trying to do (and hopefully will not change it back).
igorbernstein2
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.
This looks like a good direction. The only thing that I think needs to be addressed is what happens to users that have rpc deadline set in RetrySettings? I think this is particularly relevant for cases where retries are disabled.
Also I think that the rpc timeout methods on the RetrySettings should be marked as deprecated.
Finally should the overall timeout live in RetrySettings? If you are breaking compatibility, this might be a good time to move it elsewhere. It always bothered me that when retries are disabled, you still have to interact with RetrySettings to set a default deadline
gax/src/main/java/com/google/api/gax/retrying/ExponentialRetryAlgorithm.java
Outdated
Show resolved
Hide resolved
|
This looks good, but I think its currently missing a migration story. This is a behavioral change that could have negative repercussions for users. Some things to consider:
|
|
Thanks @igorbernstein2 you're totally right. I am first confirming the idea with some other language leads and will come back to this PR to wrap up the deprecation/roll out items you've mentioned. I'm going to leave this as a draft until we've got the plan written down. |
7a2a16f to
57aeda1
Compare
|
Closing this in favor of a different implementation strategy. |
This is a WIP PR that will deprecate the timeout-backoff implementation in ExponentialRetryAlgorithm. The first RPC in a logical call with have a deadline calculated as
now() + totalTimeout. Should that first RPC fail with a retry-able status code, the deadline of the next attempted RPC will be calculated asnow() + (totalTimeout - timeElapsed - retryDelay)where(totalTimeout - timeElapsed - retryDelay)is the amount of time left in thetotalTimeoutat the start of the next attempt after theretryDelay.