Commit 695595a
Fix "conn pool exhausted" issue. (GoogleCloudPlatform#2040)
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#3671 parent c2d8a9e commit 695595a
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
0 commit comments