Commit b69f8d4
Shield _release_reservation in acquire's create-connection failure paths
The new-slot reservation arm and the dead-conn replacement
arm both ran ``await self._release_reservation()`` un-
shielded after ``_create_connection`` raised. Outer cancel
re-arming on the await checkpoint would bypass the
decrement; each cancel-mid-create leaked one ``_size`` slot
and pools eventually wedged at ``max_size`` with no checked-
out connections.
Mirrors the existing
``await asyncio.shield(self._release_reservation())``
discipline in ``_drain_idle`` failure paths and in the
sibling ``_release`` cleanup. ``contextlib.suppress
(asyncio.CancelledError)`` absorbs the cancel
acknowledgment so the original exception (the one that
brought us into the except arm) is what propagates via
``raise``.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b70264a commit b69f8d4
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
798 | 807 | | |
799 | 808 | | |
800 | 809 | | |
| |||
973 | 982 | | |
974 | 983 | | |
975 | 984 | | |
976 | | - | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
977 | 990 | | |
978 | 991 | | |
979 | 992 | | |
| |||
0 commit comments