-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add retries functionality #178
Conversation
Hi @MatthewFlamm, you may want to consider only retrying for server errors (5xx). |
Thanks I should have made this draft as there are a few things I need to change. I didn't yet think of your point, which is a good one. I'm also unsure why the tests fail on python 3.8 and 3.9 right now. |
This might be a good time to drop support for those old versions. |
I need to look into how to best detect catch 500 errors on the client-side in At least all the python versions are failing now that I have the right test. I expect the 3.8 and 3.9 tests to continue to fail when this is fixed. I have an outside hope that we can figure out this issue, as it could be a testing problem or a testing environment problem. Just removing support is also an option as these are very old versions of python and this package is widely used for one downstream app that is always on the bleeding edge. |
This is ready for full review. It still fails in python 3.8 and python 3.9. I will leave for now in case we can figure that out. Otherwise we can drop support for those versions. The retry behavior should be generally useful given NWS flakiness. |
I was able to get a MRE for this and submitted an issue jd/tenacity#456 |
I suspect that there is some inspection logic in |
I question adding the retry logic to the existing classes as they're not used internally. Can they be moved to a separate class (or function)? |
It looks fine to me--I added some suggestions inline. |
Your comment makes sense to me, |
I forgot to remove .pylintrc, can you include that in this PR? |
LGTM |
NWS servers are flaky. This PR adds in ability to use
tenacity
to do retries. This can be done by downstream applications already, but some downstream applications, such as homeassistant prefer to have this logic done inside the upstream libraries.This implements a simple retry strategy to try every X unit of time until Y unit of time elapses.