diff options
author | Federico Caselli <cfederico87@gmail.com> | 2022-06-17 23:12:39 +0200 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-07-18 11:33:34 -0400 |
commit | 1acaf0b2e4859a274e753b5054dcde3d5c7ca10e (patch) | |
tree | d70c74d7b40e8afa6676c24b0f202e9d53c3df0d /lib/sqlalchemy/sql/expression.py | |
parent | c3102b85c40ab4578a0f56ee1e8eee4a6e0aed55 (diff) | |
download | sqlalchemy-1acaf0b2e4859a274e753b5054dcde3d5c7ca10e.tar.gz |
add shield() in aexit
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
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
0 files changed, 0 insertions, 0 deletions