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 logical timeout helper to RetrySettings #319

Merged
merged 4 commits into from May 6, 2021

Conversation

noahdietz
Copy link
Contributor

This PR adds a helper to the RetrySettings for configuring a logical call timeout. This helper, logicalTimeout, takes a single integer and applies it to each of the four existing timeout settings and sets the timeout multiplier to 1, returning an associative array for use with with() or via the retrySettings call option. The result is that each RPC attempt will take no longer than the time remaining in the overall deadline calculated at the start of the first call using the given timeout. The time remaining in this overall deadline is the timeout for each RPC attempt.

This helper is meant to simplify how users can think about the timeout settings, and reduce the need for DEADLINE_EXCEEDED to be retryable, which is an anti-pattern, but necessary for the "timeout backoff" strategy available via the existing retry/timeout logic.

@noahdietz noahdietz requested a review from a team as a code owner April 20, 2021 17:36
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 20, 2021
Copy link
Collaborator

@miraleung miraleung left a comment

Choose a reason for hiding this comment

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

LGTM, please wait for Brent's or David's review.

@miraleung miraleung requested a review from bshaffer April 20, 2021 19:36
src/RetrySettings.php Outdated Show resolved Hide resolved
@noahdietz noahdietz requested a review from dwsupplee May 5, 2021 20:54
@noahdietz noahdietz merged commit aab1234 into googleapis:master May 6, 2021
@noahdietz noahdietz deleted the with-logical-timeout branch May 6, 2021 19:21
@bshaffer bshaffer mentioned this pull request Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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

3 participants