Reduce statement timeout for user facing connections
When a request takes more than 60 seconds it gets killed as it is considered stuck.
This ends up generating a set of complications that can be avoided if we are a bit more aggressive in our DB SLA for query execution.
I propose that we reduce the statement timeout for user-facing connections (the web and the API) to a number lower than the request timeout, or even lower than that.
We should also use this to log what requests are being interrupted by this kind of exceptions (unless we already can get this through Sentry) so we can work in improving these queries.
We should also use the opportunity to investigate making the application resilient to statements being killed by the server.