Commit 7a0585a
committed
Make Pool.close() wait until all checked out connections are released
Currently, `pool.close()`, despite the "graceful" designation, closes
all connections immediately regardless of whether they are acquired.
With this change, pool will wait for connections to actually be released
before closing.
WARNING: This is a potentially incompatible behavior change, as sloppily
written code which does not release acquired connections will now cause
`pool.close()` to hang forever.
Also, when `conn.close()` or `conn.terminate()` are called directly
on an acquired connection, the associated pool item is released
immediately.
Closes: #2901 parent 8dd7a6c commit 7a0585a
File tree
5 files changed
+266
-129
lines changed- asyncpg
- tests
5 files changed
+266
-129
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
989 | | - | |
| 989 | + | |
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| |||
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
1006 | 1000 | | |
1007 | | - | |
| 1001 | + | |
| 1002 | + | |
1008 | 1003 | | |
1009 | 1004 | | |
1010 | | - | |
1011 | | - | |
| 1005 | + | |
1012 | 1006 | | |
1013 | 1007 | | |
1014 | | - | |
| 1008 | + | |
1015 | 1009 | | |
1016 | 1010 | | |
1017 | 1011 | | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
1024 | 1015 | | |
1025 | 1016 | | |
1026 | 1017 | | |
| |||
1043 | 1034 | | |
1044 | 1035 | | |
1045 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1046 | 1057 | | |
1047 | 1058 | | |
1048 | 1059 | | |
| |||
0 commit comments