ConsultingMD / activerecord5-redshift-adapter

Other
45 stars 154 forks source link

"PG::ConnectionBad: connection is closed" on Rails 5.2 #20

Open lacco opened 6 years ago

lacco commented 6 years ago

I upgraded our application to Rails 5.2 and after deployment received a lot of PG::ConnectionBad: connection is closed errors. I needed to restart the webserver and sidekiq to get rid of these errors, which fixed it for a couple of minutes. I wasn't able to reproduce it locally, and I am not sure how to fix it.

Do others have experienced similar problems? Does someone has an idea for a possible solution/ workaround?

Stacktrace:

/GEM_ROOT/gems/activerecord5-redshift-adapter-1.0.1/lib/active_record/connection_adapters/redshift/database_statements.rb:148  in async_exec 
/GEM_ROOT/gems/activerecord5-redshift-adapter-1.0.1/lib/active_record/connection_adapters/redshift/database_statements.rb:148  in block in execute 
/GEM_ROOT/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:579  in block (2 levels) in log /home/deploy/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/monitor.rb:226  in mon_synchronize 
/GEM_ROOT/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:578  in block in log 
/GEM_ROOT/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23  in instrument 
/GEM_ROOT/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:569  in log 
/GEM_ROOT/gems/activerecord5-redshift-adapter-1.0.1/lib/active_record/connection_adapters/redshift/database_statements.rb:147  in execute
lacco commented 6 years ago

After updating to Rails 5.2.1 and the newest version of the pg gem, this problem got a lot worse. Randomly, we get still this error, but at least it doesn't effect the whole application anymore...

joshRpowell commented 5 years ago

Randomly, we get still this error, but at least it doesn't effect the whole application anymore...

@lacco We're experiencing the same issue. Any additional insight since 9/3/18?