-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix(cache) Options should use the defined cache when available v2 #106938
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
base: master
Are you sure you want to change the base?
Conversation
Indexing into `caches` caused cache connection rates to drop in single-tenants. This change preserves the original behavior better than my last attempt did.
The default_cache object is a proxy that wraps Django's caches, which stores instances in a thread local.
| # Prefer the 'options' cache profile if defined. | ||
| # Use a ConnectionProxy as caches['options'] performs | ||
| # poorly in threaded contexts. | ||
| # We type ignore because django's types are lies and default_cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
django's types are lies
😆
wedamija
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's only deploy this early in the day so we have time to monitor. I didn't realise that this was the root cause of an incident I had on Friday
👍 that was my plan. |
The changes from #106115 were reverted because of issues in our production environment. These changes don't use
caches['default']and instead continue using thedefault_cacheConnectionProxy unless theoptionsbackend is configured in settings.