There's an issue reported in ruby-pg (ged/ruby-pg#325) where a query hangs and never return results to the application.
This adapter extension controls it with a ruby timeout set to 5 seconds. If the query doesn't return results in 5 seconds it aborts the async_exec
method and tries the exec
one.
We're not proud of this vut it saved a lot of erratic errors.