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

Add logging to detect concurrent token refreshes for most OAuth APIs #6322

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

robertknight
Copy link
Member

As a step towards preventing concurrent refreshes for all OAuth APIs, try to acquire the advisory lock on all OAuth token refreshes performed by OAuthHTTPService, but only prevent concurrent refreshes when the caller opts-in, which currently means only Canvas Studio. Otherwise we just write a log entry so we can count how often concurrent refreshes occur.

Tested with our D2L site for example, the log entries look like:

web-https (stderr)   | 2024-06-03 11:11:29,390 DEBUG [lms.services.oauth_http:127][MainThread] Concurrent OAuth token refresh with token URL "https://auth.brightspace.com/core/connect/token"

@robertknight robertknight requested a review from seanh June 3, 2024 10:14
As a step towards preventing concurrent refreshes for all OAuth APIs, try to
acquire the advisory lock on all OAuth token refreshes performed by
`OAuthHTTPService`, but only prevent concurrent refreshes when the caller
opts-in, which currently means only Canvas Studio. Otherwise we just write a
log entry so we can count how often concurrent refreshes occur.
@robertknight robertknight merged commit 45cb7ff into main Jun 4, 2024
9 checks passed
@robertknight robertknight deleted the concurrent-refresh-log branch June 4, 2024 10:36
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.

2 participants