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

feat: add setLogicalTimeout helper to RetrySettings #1334

Merged
merged 5 commits into from Mar 25, 2021

Conversation

noahdietz
Copy link
Contributor

@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 This human has signed the Contributor License Agreement. label Mar 23, 2021
@codecov
Copy link

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/RetrySettings.java 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 March 24, 2021 21:01
@noahdietz noahdietz requested review from a team as code owners March 24, 2021 21:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants