Commit 84435dd
committed
fix: HostConnectionPool._maybe_trash_connection not to lock connection
and pool
Locking connection a pool can lead to a deadlock.
Consider that connection.close also locks connection.
This commit also fixes condition for closing connection right away.
Instead of checking there is no in-flight requests it now checks if
in-flight requests less or equal than orphaned requests, since orphaned
requests still counts as in-flight and can be safely disregarded when connection
is dropped.1 parent 7cc1a6c commit 84435dd
1 file changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
| |||
0 commit comments