-
Notifications
You must be signed in to change notification settings - Fork 113
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
Allow retrying more than GET #266
base: main
Are you sure you want to change the base?
Conversation
@erasche Nice! Perhaps the tenacity library could be used to simplify implementation?: https://github.com/jd/tenacity |
@nuwang I'm fond of https://github.com/litl/backoff for that as well. Currently this just retains the existing implementation of retrying as it did not seem worth it to me to add a new dependency for this when the existing GET retrying logic works OK. But if that is preferred for bioblend's maintenance, we can certainly swap it for a library. I worry that it would only eliminate maybe 5-10 lines, I am under the impression we still need to retain the logic for setting the maximum values as client object attributes (not sure how that plays with decorators, never tried changing the definition of a decorator by using a variable set at runtime rather than hardcoded values,) and we still need to retain the behaviour of checking the exit code and attempting json conversion if requested |
backoff looks great! Don't think I've come across it before. Sure, makes sense if a lot of (future) variation in the retrying logic isn't expected. Calling the decorator manually with dynamic parameters is doable, but I guess it depends on what it buys, which may not be that much. I only suggested it because we've been using it in CloudBridge for some similar operations, and the library (we originally used retrying) has been fairly stable over time. |
It's a good suggestion! I personally prefer retry libraries for this since you can do nicer things like exponential backoff. Maybe @nsoranzo has an opinion when he's back from vacation |
@erasche Can you take a look at the failing tests on Travis? |
I didn't update any of the tests until I got your OK on the implementation. If you're happy with that I'll go ahead and fix the tests. |
extracted retry logic from
_get
into aretry
method._retry
?xref galaxyproject/ephemeris#98 (comment)