diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2021-01-09 13:25:55 +0100 |
|---|---|---|
| committer | Federico Caselli <cfederico87@gmail.com> | 2021-01-21 21:42:58 +0100 |
| commit | e56534995de2a97210d9c3d58183e8d245cdae94 (patch) | |
| tree | 8b820ef993bb4157b107322a6bba8f3c2d78961d /lib/sqlalchemy/pool/impl.py | |
| parent | 851a3a362ee5e05b8438f92e2e1df63c68f79d68 (diff) | |
| download | sqlalchemy-e56534995de2a97210d9c3d58183e8d245cdae94.tar.gz | |
Fix a couple of bugs in the asyncio implementation
Log an informative message if a connection is not closed
and the gc is reclaiming it when using an async dpapi, that
does not support running IO at that stage.
The ``AsyncAdaptedQueue`` used by default on async dpapis
should instantiate a queue only when it's first used
to avoid binding it to a possibly wrong event loop.
Fixes: #5823
Change-Id: Ibfc50e209b1937ae3d6599ae7997f028c7a92c33
Diffstat (limited to 'lib/sqlalchemy/pool/impl.py')
| -rw-r--r-- | lib/sqlalchemy/pool/impl.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/pool/impl.py b/lib/sqlalchemy/pool/impl.py index 825ac0307..08371a31a 100644 --- a/lib/sqlalchemy/pool/impl.py +++ b/lib/sqlalchemy/pool/impl.py @@ -13,6 +13,7 @@ import traceback import weakref +from .base import _ConnDialect from .base import _ConnectionFairy from .base import _ConnectionRecord from .base import Pool @@ -221,9 +222,14 @@ class QueuePool(Pool): return self._pool.maxsize - self._pool.qsize() + self._overflow +class _AsyncConnDialect(_ConnDialect): + is_async = True + + class AsyncAdaptedQueuePool(QueuePool): _is_asyncio = True _queue_class = sqla_queue.AsyncAdaptedQueue + _dialect = _AsyncConnDialect() class FallbackAsyncAdaptedQueuePool(AsyncAdaptedQueuePool): |
