Improve the robustness of astroquery requests
- Dominant language
- Python
- Stars
- 791
- Forks
- 451
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 4
Description
I'm proposing a few improvements to deal with networking errors in CADC and ALMA and possibly `astroquery` in general.
- Re-try mechanism for transient errors. Some servers might respond with an Http 503 error when overloaded or temporarily offline. The library should retry when encounters these errors. 503 even has a mechanism for this where the server could send a `Retry-After` field in the response. Example of such errors:
`requests.codes.unavailable,
requests.codes.service_unavailable,
requests.codes.gateway_timeout,
requests.codes.request_timeout,
requests.codes.timeout,
requests.codes.precondition_failed,
requests.codes.precondition,
requests.codes.payment_required,
requests.codes.payment`
- Ensure that the transfer is complete when downloading data and skip downloads that are not necessary (source and destination are the same). It could use both the size and the checksum to verify that. Right now the size of the downloaded file does not seem to be checked against the `Content-Length` of the file.
- Resume a download (requires HTTP Range support on the server)
- Check service is up. IVOA services have a discoverable end point to checking the status of a service.
Before I dive too deep into the implementation, please comment on these proposed improvements. Maybe they are in but I'm missing them.
Thanks
Contributor guide
Research direction
No files, tests, or entry points are named. Start by reviewing how CADC and ALMA requests and downloads are currently handled, then seek a maintainer decision on which networking improvements are in scope; done should be a clearly bounded implementation plan with acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100