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

fix: retain user RPC timeout if set via withTimeout#1324

Merged
noahdietz merged 2 commits into
googleapis:masterfrom
noahdietz:retain-with-timeout
Mar 10, 2021
Merged

fix: retain user RPC timeout if set via withTimeout#1324
noahdietz merged 2 commits into
googleapis:masterfrom
noahdietz:retain-with-timeout

Conversation

@noahdietz

@noahdietz noahdietz commented Mar 9, 2021

Copy link
Copy Markdown
Contributor

If a Callable has RetrySettings and the calculated RPC Timeout for an attempt is less than the constant, RPC timeout provided by the user via ApiCallContext.withTimeout, the attempt settings will win. This is not caller friendly.

This PR changes AttemptCallable, used for Unary RPCs, only attempts to set the ApiCallContext.withTimeout when it is not already set by the caller.

This was fixed for ServerStreaming RPCs in #1155

Addresses commentary in #1144.

@noahdietz noahdietz requested review from a team March 9, 2021 01:36
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 9, 2021
@codecov

codecov Bot commented Mar 9, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1324 (c26cac6) into master (27d92c6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1324   +/-   ##
=========================================
  Coverage     79.65%   79.65%           
- Complexity     1248     1249    +1     
=========================================
  Files           209      209           
  Lines          5461     5461           
  Branches        464      464           
=========================================
  Hits           4350     4350           
  Misses          928      928           
  Partials        183      183           
Impacted Files Coverage Δ Complexity Δ
...n/java/com/google/api/gax/rpc/AttemptCallable.java 82.60% <100.00%> (ø) 5.00 <0.00> (+1.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 27d92c6...c26cac6. Read the comment docs.

Comment thread gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java Outdated
Comment thread gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java Outdated
Comment thread gax/src/main/java/com/google/api/gax/rpc/AttemptCallable.java Outdated
@noahdietz

Copy link
Copy Markdown
Contributor Author

@elharo do you want to take another pass or am I OK to merge?

@elharo elharo 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.

You don't need to wait for me. If it's approved, you can merge

@noahdietz noahdietz merged commit 3fe1db9 into googleapis:master Mar 10, 2021
@noahdietz noahdietz deleted the retain-with-timeout branch March 10, 2021 23:40
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.

3 participants