Intermittend connection errors from Cloud Run to Cloud SQL (PostgreSQL)

We have also not seen any connection errors since moving our affected resources to Cloud Run second generation.

1 Like

Got it, thank you @KoenDeWit @mike-cloverleaf

Hello,

Facing the same issue on Cloud Run second generation and PostgreSQL 16. Some update about this case?

Hi there! On our side it seemed to be more of a consequence of unexpected timeouts than a problem by itself. We were using Gemini via Vertex AI, with multi-threading (ThreadPoolExecutor), then sending Gemini’s answer to Postgres. The thread was stuck, never really producing a timeout nor closing properly, leading to a timeout of cloud Run, in turn leading to a timeout of the cloud SQL connexion.

We replace threads with ProcessPoolExecutor, added a timeout and moved all the requests to PostgresSQL out of the pools. Now it seems to work just fine, didn’t have the issue in a while.