PgSQL backend may terminate immediately when connection is lost
The code in pgsql_connection.cc may call exit() under certain conditions. There are couple areas for improvement here:
-
this was perhaps acceptable behavior when we didn't have any connection failure handling routines, but wasn't that improved in 1.3?
-
calling exit() explicitly is not acceptable. If we really want to shut down, we should go through a graceful shutdown (unload hooks, close connections, let HA partner know we're going down, etc.)
-
if somehow there are good justifications why 1 and 2 can be ignored, at the very least we need to print out an error and explain why we are terminating.
On a related note, MySQL also does have DB connection lost handling code and it doesn't call exit.