Using reconnect! assumes that the connection is still valid. ActiveRecord will attempt to execute queries against that connection, and crash here because there is no error handling.
Specifically, we were experiencing uncaught PG::UnableToSend errors generated by this line, because ActiveRecord attempts to dealloc items as part of the reconnect! process.
Using
reconnect!
assumes that the connection is still valid. ActiveRecord will attempt to execute queries against that connection, and crash here because there is no error handling.Specifically, we were experiencing uncaught
PG::UnableToSend
errors generated by this line, because ActiveRecord attempts to dealloc items as part of thereconnect!
process.