Skip to content
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: add setLogicalTimeout helper to RetrySettings #1334

merged 5 commits into from Mar 25, 2021


Copy link

@noahdietz noahdietz commented Mar 23, 2021

Adds a helper to the RetrySettings.Builder to set a logical call timeout. setLogicalTimeout takes the given timeout and applies it to each of the three timeout settings in RetrySettings and sets the timeout multiplier to one to keep it constant. In combination with the ExponentialRetryAlgorithm, the first RPC attempt will have the entire timeout, and any subsequent attempts will have only the time remaining in the timeout. Effectively, users will see their callable "timeout" and return an error after their given timeout has been used up. Under the hood, each RPC attempt respects the deadline calculated from the start of the first attempt with the given timeout, and will use as much time as is left.

@google-cla google-cla bot added the cla: yes label Mar 23, 2021
Copy link

@codecov codecov bot commented Mar 23, 2021

Codecov Report

Merging #1334 (6d80e1b) into master (49efdc3) will increase coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1334      +/-   ##
+ Coverage     80.34%   80.53%   +0.18%     
  Complexity     1331     1331              
  Files           210      210              
  Lines          5682     5686       +4     
  Branches        519      519              
+ Hits           4565     4579      +14     
+ Misses          912      895      -17     
- Partials        205      212       +7     
Impacted Files Coverage Δ Complexity Δ
...ava/com/google/api/gax/retrying/ 55.76% <100.00%> (+24.51%) 2.00 <0.00> (ø)

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 49efdc3...6d80e1b. Read the comment docs.

@noahdietz noahdietz marked this pull request as ready for review Mar 24, 2021
@noahdietz noahdietz requested review from as code owners Mar 24, 2021
@noahdietz noahdietz merged commit 97d3214 into googleapis:master Mar 25, 2021
9 checks passed
@noahdietz noahdietz deleted the retry-settings-logical-timeout branch Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
cla: yes
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants