You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated code to return connection to pool before returning a value from the "With" block. When I tried running demo code in a gcloud function without using .putconn() to return the connection to the pool, 3 out of every 4 function invocations failed and returned error "connection pool exhausted" while fourth invocation worked successfully.
Note that creating a cursor object using a With statement doesn't automatically return a connection to the pool after the With statement executes - psycopg/psycopg2#367
0 commit comments