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

Deprecation warning with Rails 7.1 #425

Open
fragkakis opened this issue Apr 12, 2024 · 2 comments
Open

Deprecation warning with Rails 7.1 #425

fragkakis opened this issue Apr 12, 2024 · 2 comments

Comments

@fragkakis
Copy link

Hello, thank you for the library!

With rails 7.1 I get the following deprecation warning:

WarningHandlers::Rails::Deprecation: 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. (called from run_job_middleware at (eval):11)

The stack trace is the following:

  "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_handler.rb:187:in `clear_active_connections!'",
      "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.2/lib/active_record/connection_handling.rb:321:in `clear_active_connections!'",
      "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/que-2.3.0/lib/que/active_record/connection.rb:45:in `call'",
      "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/que-2.3.0/lib/que/utils/middleware.rb:36:in `invoke_middleware'",
      "(eval):11:in `run_job_middleware'",
      "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/que-2.3.0/lib/que/worker.rb:103:in `work_job'",
      "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/que-2.3.0/lib/que/worker.rb:76:in `work_loop'",
      "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/que-2.3.0/lib/que/worker.rb:46:in `block in initialize'",
      "/home/workable/app/vendor/bundle/ruby/3.2.0/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'"

I noticed there are 2 occasions of clear_active_connections! called in que without an argument, so I guess both should be handled.

@fragkakis
Copy link
Author

Closing, noticed the relevant PR.

@fragkakis fragkakis reopened this Apr 26, 2024
@fragkakis
Copy link
Author

Reopening because the PR has not been merged.

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

No branches or pull requests

1 participant