-
Notifications
You must be signed in to change notification settings - Fork 32
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
Rotate auth token in backoff_handler #131
Conversation
I am SHOCKED that the backoff library doesn't return the response or even just its status code... Anyways, investigating this I found out that we were missing a key component, actually updating to the SDK that has this new featured 😉 |
@laurentS looks like upgrading the SDK broke tests around |
I opened - litl/backoff#158 Noting that the SDK should upgrade to |
Yup, we're blocked by transferwise/pipelinewise-singer-python#61
What you want is already possible in backoff We ended up porting it to the SDK (because of the blocker above) as Wdyt? |
I found a way to rotate the token only on relevant errors. It's probably not the most reliable solution, but should be fine as a temp fix until the PRs mentioned above are merged. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This PR fixes #129 to handle the edge case described in it.
The limit to this is that the token will be rotated on every
RetriableAPIError
with this code, which may not be desirable.I don't see any obvious way to prevent this, short of throwing a different exception upon rate limit errors, which would require modifying
request_decorator
. Happy to hear any other ideas :)