Skip to content

Commit dc7aec4

Browse files
committed
add asyncio.CancelledError to terminate conditions
Revising the asyncpg ``terminate()`` fix first made in 🎫`10717` which improved the resiliency of this call under all circumstances, adding ``asyncio.CancelledError`` to the list of exceptions that are intercepted as failing for a graceful ``.close()`` which will then proceed to call ``.terminate()``. Fixes: #11821 Change-Id: Ic5e21cd18cc5517aae372560c52b2b2396c65483
1 parent f746fd7 commit dc7aec4

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. change::
2+
:tags: bug, postgresql
3+
:tickets: 11821
4+
5+
Revising the asyncpg ``terminate()`` fix first made in :ticket:`10717`
6+
which improved the resiliency of this call under all circumstances, adding
7+
``asyncio.CancelledError`` to the list of exceptions that are intercepted
8+
as failing for a graceful ``.close()`` which will then proceed to call
9+
``.terminate()``.

‎lib/sqlalchemy/dialects/postgresql/asyncpg.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ def terminate(self):
902902
await_(self._connection.close(timeout=2))
903903
except (
904904
asyncio.TimeoutError,
905+
asyncio.CancelledError,
905906
OSError,
906907
self.dbapi.asyncpg.PostgresError,
907908
):

0 commit comments

Comments
 (0)