new:dev:SDK-386:Add Retries and Delay Options in python-sdk#295
Merged
chattarajoy merged 21 commits intoqubole:unreleasedfrom Jan 30, 2020
shekharsaurabh:INFRA-2843_1
Merged
new:dev:SDK-386:Add Retries and Delay Options in python-sdk#295chattarajoy merged 21 commits intoqubole:unreleasedfrom shekharsaurabh:INFRA-2843_1
chattarajoy merged 21 commits intoqubole:unreleasedfrom
shekharsaurabh:INFRA-2843_1
Conversation
yogesh2021
reviewed
Jan 20, 2020
shekharsaurabh
commented
Jan 20, 2020
qds_sdk/qubole.py
Outdated
| """ | ||
|
|
||
| MIN_POLL_INTERVAL = 1 | ||
| RETRIES_CAP = 6 |
Contributor
Author
There was a problem hiding this comment.
Calculated the values as follow-
With backoff factor as 2 and retry count of 6, we will be retrying 5 times, till the retry_count is >1, decrementing it on each retry. Keeping base_delay as 10sec,
Thus, all retries will be completed within
10 + 20 + 40 + 80 + 160 = 310sec (around 5 minutes)
yogesh2021
previously approved these changes
Jan 23, 2020
bin/qds.py
Outdated
| optparser.add_option("--max_retries", dest="max_retries", | ||
| type=int, | ||
| default=os.getenv('QDS_MAX_RETRIES'), | ||
| help="Number of re-attempts for an api-call in case of retryable exceptions. defaults to 6." |
There was a problem hiding this comment.
This should be 5, please propogate the change in other code places as well. Handle this in the loop if needed.
chattarajoy
requested changes
Jan 24, 2020
|
|
||
| @retry((RetryWithDelay, requests.Timeout, ServerError), tries=6, delay=30, backoff=2) | ||
| def retry(ExceptionToCheck, tries=5, delay=10, backoff=2): | ||
| def deco_retry(f): |
Member
There was a problem hiding this comment.
can we add some unit tests for this method? As the retry logic isn't very straightforward anymore.
added 10 commits
January 27, 2020 12:17
chattarajoy
approved these changes
Jan 29, 2020
Member
|
@shekharsaurabh , please merge the latest unreleased to your branch so that we can merge the changes. |
chattarajoy
pushed a commit
that referenced
this pull request
Feb 18, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of API throttling phase-2 dev, we are extending the capability to add retries and delay options for the user which can be consumed in case of RetryableExceptions.