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

Don't cache overdrive token in credentials table (PP-1717) #2060

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

jonathangreen
Copy link
Member

Description

Don't cache the overdrive authentication token in the credentials table. Instead just refresh it when we need it. This prevents multiple threads / processes from getting into a deadlock waiting on postgres transactions that are all trying to update the same credential object.

Motivation and Context

Debugging the deadlock in PP-1717, and this is a factor in that deadlock. It may not be the only issue, but its one of the factors causing this deadlock.

This will mean calling out to get a session token slightly more often, but it shouldn't matter doing one extra call to their API now and then. If we were really concerned we could cache these in redis, but it doesn't seem worth the effort.

How Has This Been Tested?

  • Tested locally

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@jonathangreen jonathangreen requested a review from a team September 16, 2024 19:52
@jonathangreen jonathangreen added the bug Something isn't working label Sep 16, 2024
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.79%. Comparing base (96b10e6) to head (eb2ace5).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2060   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files         343      343           
  Lines       40584    40579    -5     
  Branches     8790     8788    -2     
=======================================
- Hits        36847    36843    -4     
  Misses       2483     2483           
+ Partials     1254     1253    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathangreen jonathangreen added the cleanup migration PR that will need a cleanup migration once its been fully deployed label Sep 16, 2024
Copy link
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

@jonathangreen jonathangreen merged commit 300c2f7 into main Sep 17, 2024
20 checks passed
@jonathangreen jonathangreen deleted the bugfix/overdrive-token branch September 17, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cleanup migration PR that will need a cleanup migration once its been fully deployed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants