Skip to content

Instantly share code, notes, and snippets.

@tierra
Created May 31, 2018 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tierra/09481964a29f2834e24d9d8320b6ae81 to your computer and use it in GitHub Desktop.
Save tierra/09481964a29f2834e24d9d8320b6ae81 to your computer and use it in GitHub Desktop.
[15] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.execute 'SELECT 1'
=> #<PG::Result:0x00000000047e2120 status=PGRES_TUPLES_OK ntuples=1 nfields=1 cmd_tuples=1>
[16] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.active?
=> true
[17] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.execute 'SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid = pg_backend_pid()'
ActiveRecord::StatementInvalid: PG::UnableToSend: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
: SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid = pg_backend_pid()
from /home/docker/.rvm/gems/ruby-2.3.6/gems/activerecord-5.0.6/lib/active_record/connection_adapters/postgresql/database_statements.rb:98:in `async_exec'
[18] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.execute 'SELECT 1'
ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: SELECT 1
from /home/docker/.rvm/gems/ruby-2.3.6/gems/activerecord-5.0.6/lib/active_record/connection_adapters/postgresql/database_statements.rb:98:in `async_exec'
[19] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.active?
=> false
[20] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.verify!
=> []
[21] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.execute 'SELECT 1'
=> #<PG::Result:0x00000000046246f8 status=PGRES_TUPLES_OK ntuples=1 nfields=1 cmd_tuples=1>
[23] pry(#<RSpec::ExampleGroups::SwitchmanActiveRecordConnectionPool>)> @conn.active?
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment