Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Fix logic to remove retries from callable chains. - #668

Merged
igorbernstein2 merged 2 commits into
googleapis:masterfrom
igorbernstein2:fix-retry-removal
Feb 14, 2019
Merged

Fix logic to remove retries from callable chains.#668
igorbernstein2 merged 2 commits into
googleapis:masterfrom
igorbernstein2:fix-retry-removal

Conversation

@igorbernstein2

Copy link
Copy Markdown
Contributor

No description provided.

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 14, 2019
@codecov

codecovBot commented Feb 14, 2019

Copy link
Copy Markdown

Codecov Report

Merging #668 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@ 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
Impacted FilesCoverage ΔComplexity Δ
...rc/main/java/com/google/api/gax/rpc/Callables.java68.88% <66.66%> (+0.7%)10 <5> (+3)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eeea903...a11d70d. Read the comment docs.

// 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()

Copy link
Copy Markdown
Contributor

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:

  1. What does initialRpcTimeout == 0 means from sever side point of view (does it mean "no timeout", call takes as much time as it needs?)
  2. Aren't retrySettings.maxAttempts() == 1 and retryableCodes.isEmtpy() themselves are enough to disable retries (why is initialRpcTimeout relevant here)? I.e. why not just the following:
returnretrySettings.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.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

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

  2. Ok I'll remove it

@igorbernstein2

Copy link
Copy Markdown
ContributorAuthor

updated, ptal

@vam-googlevam-google left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@igorbernstein2
igorbernstein2 merged commit e8d798c into googleapis:masterFeb 14, 2019
This was referenced Feb 20, 2019
This was referenced Feb 28, 2019
@igorbernstein2
igorbernstein2 deleted the fix-retry-removal branch November 19, 2021 18:06
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@igorbernstein2@vam-google@googlebot