Skip to content

Conversation

@markstory
Copy link
Member

The changes from #106115 were reverted because of issues in our production environment. These changes don't use caches['default'] and instead continue using the default_cache ConnectionProxy unless the options backend is configured in settings.

Indexing into `caches` caused cache connection rates to drop in
single-tenants. This change preserves the original behavior better
than my last attempt did.
@markstory markstory requested a review from a team January 24, 2026 19:01
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 24, 2026
@markstory markstory marked this pull request as draft January 24, 2026 20:44
The default_cache object is a proxy that wraps
Django's caches, which stores instances in
a thread local.
@markstory markstory marked this pull request as ready for review January 26, 2026 14:45
# 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
Copy link
Member

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

😆

Copy link
Member

@wedamija wedamija left a 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

@markstory
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

4 participants