Commit d282c13
committed
Fix connection hang in database_is_empty() for SerenDB/Neon targets
Reuse the existing target_client connection instead of creating a new
connection when checking if a database is empty. This prevents connection
pool exhaustion on serverless PostgreSQL providers (SerenDB, Neon) that
have strict concurrent connection limits.
The previous implementation would create a second connection while the
first was still open, causing indefinite hangs when the connection pool
was exhausted. Since tokio_postgres::connect has no built-in timeout,
the operation would hang forever.
Fixes #231 parent 69f37c6 commit d282c13
1 file changed
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
409 | | - | |
| 408 | + | |
| 409 | + | |
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
685 | 684 | | |
686 | 685 | | |
687 | 686 | | |
| |||
1223 | 1222 | | |
1224 | 1223 | | |
1225 | 1224 | | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
1226 | 1230 | | |
1227 | 1231 | | |
1228 | | - | |
| 1232 | + | |
1229 | 1233 | | |
1230 | 1234 | | |
1231 | 1235 | | |
0 commit comments