-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ``asyncio.shield()`` to the connection and session release process specifically within the ``__aexit__()`` context manager exit, when using :class:`.AsyncConnection` or :class:`.AsyncSession` as a context manager that releases the object when the context manager is complete. This appears to help with task cancellation when using alternate concurrency libraries such as ``anyio``, ``uvloop`` that otherwise don't provide an async context for the connection pool to release the connection properly during task cancellation. Fixes: #8145 Change-Id: I0b1ea9c3a22a18619341cbb8591225fcd339042c
- Loading branch information
Showing
3 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. change:: | ||
:tags: bug, asyncio | ||
:tickets: 8145 | ||
|
||
Added ``asyncio.shield()`` to the connection and session release process | ||
specifically within the ``__aexit__()`` context manager exit, when using | ||
:class:`.AsyncConnection` or :class:`.AsyncSession` as a context manager | ||
that releases the object when the context manager is complete. This appears | ||
to help with task cancellation when using alternate concurrency libraries | ||
such as ``anyio``, ``uvloop`` that otherwise don't provide an async context | ||
for the connection pool to release the connection properly during task | ||
cancellation. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters