-
Notifications
You must be signed in to change notification settings - Fork 236
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
hermetic: retry on failed network requests #1512
hermetic: retry on failed network requests #1512
Conversation
9cfec07
to
169bbdb
Compare
Thank you for working on this early feature! |
mock/py/mock-hermetic-repo.py
Outdated
return wrapper | ||
|
||
|
||
@retry(retry_on=requests.exceptions.ConnectionError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered python-backoff? Mock already depends on it so it is not a new dep:
mock/mock/py/mockbuild/file_downloader.py
Lines 67 to 68 in 5193dbd
@backoff.on_exception(backoff.expo, requests.exceptions.RequestException, | |
max_tries=3, max_time=100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, no! I was not aware of it. We should use that.
I'd prefer to have a short message, nothing more than "the mock-hermetic-repo implements retry-mechanism for downloading files" is needed. |
169bbdb
to
a6f5f46
Compare
a6f5f46
to
27eeb4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
No release note required for this one, I think. Pretty small change.