Skip to content

Fix ActiveRecord::Base.clear_on_handler#104

Merged
bquorning merged 3 commits intomasterfrom
bquorning.fix-clear-query-cache-patch
Jan 18, 2023
Merged

Fix ActiveRecord::Base.clear_on_handler#104
bquorning merged 3 commits intomasterfrom
bquorning.fix-clear-query-cache-patch

Conversation

@bquorning
Copy link
Copy Markdown
Member

Fix the patch for ActiveRecord::Base.clear_on_handler to work correctly right after the creation of a new connection pool.

In doing this, we add ActiveRecordHostPool::PoolProxy#_unproxied_connection which gives access to the underlying, "real", shared connection without going through the connection proxy, which would call #_host_pool_current_database= on the underlying connection.

Fix the patch for `ActiveRecord::Base.clear_on_handler` to work correctly
right after the creation of a new connection pool.

In doing this, we add `ActiveRecordHostPool::PoolProxy#_unproxied_connection`
which gives access to the underlying, "real", shared connection without going
through the connection proxy, which would call `#_host_pool_current_database=`
on the underlying connection.

Co-authored-by: Nony Dutton <nony.dutton@zendesk.com>
@bquorning bquorning marked this pull request as ready for review January 18, 2023 12:39
@bquorning bquorning requested review from a team as code owners January 18, 2023 12:39
@bquorning bquorning requested a review from bestie January 18, 2023 12:40
We don't want to accidentally test on Ruby 3.2, just because `3.0` is coerced into `3`.
@bquorning bquorning merged commit 329706b into master Jan 18, 2023
@bquorning bquorning deleted the bquorning.fix-clear-query-cache-patch branch January 18, 2023 12:49
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