-
Notifications
You must be signed in to change notification settings - Fork 104
Fix logic to remove retries from callable chains. #668
Fix logic to remove retries from callable chains. #668
Conversation
Codecov Report
@@ Coverage Diff @@
## master #668 +/- ##
============================================
+ Coverage 75.94% 75.94% +<.01%
- Complexity 1014 1017 +3
============================================
Files 190 190
Lines 4452 4453 +1
Branches 346 346
============================================
+ Hits 3381 3382 +1
Misses 915 915
Partials 156 156
Continue to review full report at Codecov.
|
| // RetryingCallable affects the rpc deadline of the initial attempt and the number of retries. | ||
| // If the rpc timeout is disabled and no further attempts can be made, then the retry | ||
| // infrastructure can be removed. | ||
| return retrySettings.getInitialRpcTimeout().isZero() |
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.
retrySettings.getInitialRpcTimeout().isZero() in && is suspicious. I have two questions:
- What does
initialRpcTimeout == 0means from sever side point of view (does it mean "no timeout", call takes as much time as it needs?) - Aren't
retrySettings.maxAttempts() == 1andretryableCodes.isEmtpy()themselves are enough to disable retries (why isinitialRpcTimeoutrelevant here)? I.e. why not just the following:
return retrySettings.getMaxAttempts() == 1 || retryableCodes.isEmpty();Otherwise, if retrySettings.getInitialRpcTimeout().isZero() == false, but retrySettings.getMaxAttempts() == 1 || retryableCodes.isEmpty() == true, the whole expression gives false. Then, if something fails, the process goes into retrying infrastructure, but it immediately determines it as non-retriabel (one attempt is made, and one is already the maximum) and terminates.
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.
-
initialRpcTimeout doesn't have a meaning on the serverside. However, gax treats 0 as unset:
https://github.com/googleapis/gax-java/blob/master/gax/src/main/java/com/google/api/gax/rpc/AttemptCallable.java#L72-L75 -
Ok I'll remove it
|
updated, ptal |
vam-google
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.
LGTM
No description provided.