rescale-labs / rescale-htc-python

MIT License
1 stars 0 forks source link

Automatic retries on ConnectTimeout? #2

Open christiangrovdal opened 2 months ago

christiangrovdal commented 2 months ago

Occasionally the HTC API calls may time out, with an ConnectionResetError or ConnectTimeout exception being raised by the library.

There are suggestions to implement a retry mechanism in this python library itself, instead of handing off this responsibility to end-users. We could use something like https://requests.readthedocs.io/en/latest/user/advanced/#example-automatic-retries . The number of retries should be configurable, for example through the RescaleHtc object, with a sensible default setting (possibly 1).

Thoughts on this?

christiangrovdal commented 2 months ago

Assigned to @bdobrzelecki-rescale for a Rescale opinion. We can contribute code for the actual change.