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

Rails 7.1 deprecation (for change in 7.2) in call to "clear_active_connections!" #358

Closed
TomNaessens opened this issue Jan 31, 2025 · 1 comment

Comments

@TomNaessens
Copy link

TomNaessens commented Jan 31, 2025

There's a deprecation warning in Rails 7.1 starting from Rails 7.2 in

if defined? ActiveRecord::Base.connection_handler
ActiveRecord::Base.connection_handler.clear_active_connections!
elsif defined? ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.clear_active_connections!
end

DEPRECATION WARNING: clear_active_connections! currently only applies to connection pools in the current role (writing). In Rails 7.2, this method will apply to all known pools, regardless of role. To affect only those connections belonging to a specific role, pass the role name as an argument. To switch to the new behavior, pass :all as the role name.

Added in rails/rails@74cb960

@Flink
Copy link
Contributor

Flink commented Feb 18, 2025

The new behavior isn’t a problem, as we’ve been running Rails 7.2 at Discourse since November. Anyway, I just merged a PR (#359) to prevent this deprecation warning with Rails 7.1.

Thanks for the report!

@Flink Flink closed this as completed Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants