We have a rails 4 app that has a scheduled rake task, which will spawn sidekiq workers, and we started to see errors:
An ActiveRecord::ConnectionNotEstablished occured in background
Exception
No connection pool for User
config/initializers/leaked_connections.rb:44:in `connection_with_forbid_implicit'
lib/ads_apis/ads_geo_targeter_base.rb:75:in `seeder_sync_targeting'
which is simply:
user = User.find(user_id)
we tried to lower the concurrency at sidekiq settings and increasing the pool size at the database settings, but hasn't fixed the issue, and we keep getting No connection pool for
for models at the app.
Is there any hint to investigate this ?