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: Customize retry implementation #680

Merged
merged 6 commits into from
Jul 9, 2021

Conversation

shaffeeullah
Copy link
Contributor

Developed for supporting retries in nodejs-storage. https://github.com/googleapis/nodejs-storage/pull/1493/files

Unit tests pass. Have tested locally linked with storage and that works as expected. Conformance testing will be written from storage to verify retry functionality further.

Adds the RetryOptions interface which allows users to configure retryDelayMultiplier, totalTimeout, maxRetryDelay, autoRetry, maxRetries, and retryableErrorFn

shaffeeullah and others added 2 commits July 7, 2021 12:49
* feat: began retry configuration implementation

* 🦉 Updates from OwlBot

* added semicolon

* 🦉 Updates from OwlBot

* removed log statement

* refactored constants

* updated retry-request and made relevant updates in this lib

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* feat: implemented retry function

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

* refactored retryableErrorFn into retry config

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

* refactored code so test stub works as expected

* removed print

* added test

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

* refactored function

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
@shaffeeullah shaffeeullah requested a review from a team as a code owner July 9, 2021 18:17
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 9, 2021
@shaffeeullah shaffeeullah requested a review from bcoe July 9, 2021 18:24
return err && util.shouldRetryRequest(err);
},
maxRetryDelay: config.retryOptions?.maxRetryDelay,
retryDelayMultiplier: config.retryOptions?.retryDelayMultiplier,
totalTimeout: config.retryOptions?.totalTimeout,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stephenplusplus The system test is failing because it is passing retry-request undefined for these three values (maxRetryDelay, retryDelayMultiplier, and totalTimeout). Do you think that common should be defining defaults and always passing those defaults here? Or should retry-request be using its defaults if it receives an undefined value?

Copy link
Contributor

Choose a reason for hiding this comment

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

retry-request! PTAL: googleapis/retry-request#37

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Amazing! Thank you :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for catching it! The fix is now released in 4.2.2.

@stephenplusplus
Copy link
Contributor

smh at myself. Sorry to auto-close this 😞

@shaffeeullah shaffeeullah merged commit b529998 into master Jul 9, 2021
@shaffeeullah shaffeeullah deleted the shaffeeullah/storageRetryStrategy branch July 9, 2021 19:56
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

4 participants