-
Notifications
You must be signed in to change notification settings - Fork 20
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
raise error if not 200 sstatus code #82
Conversation
I have mixed feelings about this. I see plenty of cases where a given page/request will timeout with a
The request for For the backfill case, a |
Perhaps using a library like this one could allow for retrying API endpoints, while still allowing for non-ephemeral failures to propagate up to the system? |
Ah... let me back up, because I wasn't thinking clearly with my earlier comment. Obviously if a given page throws an error we wouldn't get anything back to have a I think the core issue is, if we This is probably more an argument in favor of something like proposed/discussed in #13 and CityofSantaMonica/mds-provider-services#61 than anything else. On that note, @hunterowens would you mind rebasing on the latest |
I wonder if, in practice, using something like exponential backoff would be effective in mitigating failures like what you describe @thekaveman. We would then only raise if the last attempt (maybe 10th try, could be configurable) failed. We would still lose prior pages, but maybe not very often, and a true failure-after-ten-retries would be something worth looking at.
I don't think it would be a problem to move to an asynchonous execution model, though it probably wouldn't help too much, since each page link is derived from the previous one, so the amount of concurrency is pretty low (unless you start to parallelize across different providers or different time windows). |
These changes would need to be rebased on latest Suggest opening a new PR if changes are still desired. |
Currently, if
get_status_changes
orget_trips
runs and returns a not 200 status code, the __describe() method is run but doesn't actually raise a python error, meaning the code continues to run.This PR wraps the request block inside try/ except that runs __describe and then raises an error, which should stop program execution.