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

Handle error responses from API token endpoint #325

Merged

Conversation

mbthornton-lbl
Copy link
Contributor

@mbthornton-lbl mbthornton-lbl commented Dec 9, 2024

This PR seeks to address a failure where the Watcher gets a 401 unauthorized response from the jobs endpoint.

Underlying cause appears to be a non-200 return from the /token endpoint. This PR seeks to address this by:

  • adding tenacity python lib to project
  • decorating get_token with @retry with exponential backoff
  • adding unit test for the above
  • adding integration tests
  • updating project.toml and .github action to not run @pytest.mark.integration tests

@mbthornton-lbl mbthornton-lbl linked an issue Dec 9, 2024 that may be closed by this pull request
Copy link

@shreddd shreddd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable

Copy link
Collaborator

@scanon scanon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

You could add a few unit tests for this.

@aclum
Copy link
Contributor

aclum commented Dec 17, 2024

where is the 401 handling?

Cannot replicate the error with client with expired token
@mbthornton-lbl mbthornton-lbl changed the title Handle token expiration in day(s) or minutes Handle error responses from API token endpoint Dec 17, 2024
@mbthornton-lbl mbthornton-lbl marked this pull request as ready for review December 17, 2024 19:45
@mbthornton-lbl mbthornton-lbl merged commit 9db3bdf into main Dec 17, 2024
1 check passed
@mbthornton-lbl mbthornton-lbl deleted the 317-watcher-get-401-unauthorized-error-from-jobs-endpoint branch December 17, 2024 22:54
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

Successfully merging this pull request may close these issues.

Watcher get 401 unauthorized error from jobs endpoint
4 participants