Skip to content
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

Fix token refresh on unstable connections #7

Open
dirkkul opened this issue Mar 13, 2023 · 0 comments
Open

Fix token refresh on unstable connections #7

dirkkul opened this issue Mar 13, 2023 · 0 comments

Comments

@dirkkul
Copy link
Contributor

dirkkul commented Mar 13, 2023

On unstable connections, the token refresh can sometimes fail which can results in unauthenticated clients.

To be able to handle these situations, the client should:

  • set a default timeout for auth connections. We used 5s in the python client, this should be plenty
  • make sure that the refresh happens early enough to still be authenticated if it fails. In the python client we refresh 30s before the authentication expires.
  • catch exceptions about timeouts and immediately retry. Note that I saw timeouts and Connection errors (not sure about the names for them here)

With this we should be able to have 3-4 retries. If this is not enough, the connection is too bad.

Python PR with the changes and a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant