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

clear_query_caches_for_current_thread: avoid pinning all connections #51151

Merged
merged 1 commit into from Feb 21, 2024

Conversation

casperisfine
Copy link
Contributor

@casperisfine casperisfine commented Feb 21, 2024

Ref: #51083 (comment)

Now that the query_cache is owned by the pool, we can clear it without having to checkout a connection.

cc @matthewd @bensheldon

Ref: rails#51083 (comment)

Now that the pool is owned by the pool, we can clear it without
hacing to checkout a connection.
@byroot byroot merged commit 4ab6a36 into rails:main Feb 21, 2024
4 checks passed
casperisfine pushed a commit to Shopify/rails that referenced this pull request Feb 26, 2024
casperisfine pushed a commit to Shopify/rails that referenced this pull request Feb 29, 2024
Ref: Shopify/maintenance_tasks#983 (comment)
Ref: rails#51151

Now that query caches are owned by the pool, and assigned on connections
during checkout, when running multithreaded code inside transactional
tests (typically system tests), the two threads uses the same connection
but not the same cache.

So it's important that we do clear the caches for all threads when
a connection is pinned.
viralpraxis pushed a commit to viralpraxis/rails that referenced this pull request Mar 24, 2024
Ref: Shopify/maintenance_tasks#983 (comment)
Ref: rails#51151

Now that query caches are owned by the pool, and assigned on connections
during checkout, when running multithreaded code inside transactional
tests (typically system tests), the two threads uses the same connection
but not the same cache.

So it's important that we do clear the caches for all threads when
a connection is pinned.
fractaledmind pushed a commit to fractaledmind/rails that referenced this pull request May 13, 2024
Ref: Shopify/maintenance_tasks#983 (comment)
Ref: rails#51151

Now that query caches are owned by the pool, and assigned on connections
during checkout, when running multithreaded code inside transactional
tests (typically system tests), the two threads uses the same connection
but not the same cache.

So it's important that we do clear the caches for all threads when
a connection is pinned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants