rails/rails — pull request #6557 by stevecj (2012-05-30 23:39:48+00:00)
Title: Postgresql auto reconnect

After a Rails process has opened a connection to a PostgreSQL server, if the PostgreSQL server is subsequently restarted, or the connection has been otherwise severed, the connection would fail with an exception the next time a query was attempted using that connection.

With these changes, the connection will automatically be repaired on the next query, assuming it is safe to do so (e.g. we were not in the middle of a transaction).

Some of the commits on this branch are also to fix test failures or intermittent test failures/fragilities that are unrelated or only tangentially related to the auto-reconnect changes (2 failures on TC before I started, tests that fail only when run in certain combinations, etc.)