cpoms / innkeeper

Apartment clone with threadsafe multihost support
7 stars 2 forks source link

Passenger 6.0.5 breaks host switching #5

Open mikecmpbll opened 3 years ago

mikecmpbll commented 3 years ago

When Passenger spawns a new app process it now calls establish_connection on ActiveRecord::Base, which causes connection_specification_name to be set back to :primary after we've already set it to nil in the main process. We depend on it being nil so that our custom switching code can take precedence.

With this change, connection_specification_name will always be :primary on spawned processes thus not allowing them to connect to other hosts (or any hosts, if your :primary config is not a production config)

mikecmpbll commented 3 years ago

https://github.com/phusion/passenger/issues/2253

mikecmpbll commented 3 years ago

https://github.com/mikecmpbll/apartment/commit/8405fa7b2d94eae1fb6579005a4add52bdf1496f