ManageIQ / manageiq

ManageIQ Open-Source Management Platform
https://manageiq.org
Apache License 2.0
1.35k stars 900 forks source link

Opt-in to the new rails connection handling #23171

Closed agrare closed 2 months ago

agrare commented 2 months ago

Rails began warnings about legacy connection handling being deprecated:

[----] D, [2024-09-03T09:25:16.211243#11476:87dc] DEBUG -- development: PostgreSQLAdapter#log_after_checkin, connection_pool: size: 5, connections: 1, in use: 0, waiting_in_queue: 0
[----] W, [2024-09-03T09:25:27.211621#11594:87c8]  WARN -- development: DEPRECATION WARNING: Using legacy connection handling is deprecated. Please set
`legacy_connection_handling` to `false` in your application.

The new connection handling does not support `connection_handlers`
getter and setter.

Read more about how to migrate at: https://guides.rubyonrails.org/active_record_multiple_databases.html#migrate-to-the-new-connection-handling
 (called from <main> at /home/grare/adam/src/manageiq/manageiq/config/environment.rb:5)

https://guides.rubyonrails.org/v7.0/active_record_multiple_databases.html#migrate-to-the-new-connection-handling

I don't see us using the deprecated #connection_handlers anywhere (except the archived 11yr old rails fork) https://github.com/search?q=org%3AManageIQ+connection_handler&type=code so it looks like we're safe to opt-in to the new connection handlers.

Fryguy commented 2 months ago

Backported to radjabov in commit 3acd8790a66e9bc0262c67d64f5850d6f55c25d9.

commit 3acd8790a66e9bc0262c67d64f5850d6f55c25d9
Author: Joe Rafaniello <jrafanie@users.noreply.github.com>
Date:   Tue Sep 3 11:53:07 2024 -0400

    Merge pull request #23171 from agrare/disable_legacy_connection_handling

    Opt-in to the new rails connection handling

    (cherry picked from commit ec3debfeb2ca89ae5cfc865d6a2bd2f7ba821208)