diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-07 11:28:49 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-07 12:44:58 -0400 |
| commit | 2fa39312b2c878b717d4c4f41380e5a8931eb374 (patch) | |
| tree | b9b33cf021e82227bd6ab237a06922e0388769be /lib/sqlalchemy/engine/base.py | |
| parent | 94169108cdd4dace09b752a6af4f4404819b49a3 (diff) | |
| download | sqlalchemy-2fa39312b2c878b717d4c4f41380e5a8931eb374.tar.gz | |
Add asyncio.TimeoutError as an exit exception
Added ``asyncio.exceptions.TimeoutError``,
``asyncio.exceptions.CancelledError`` as so-called "exit exceptions", a
class of exceptions that include things like ``GreenletExit`` and
``KeyboardInterrupt``, which are considered to be events that warrant
considering a DBAPI connection to be in an unusable state where it should
be recycled.
Fixes: #6592
Change-Id: Idcfa7aaa2d7660838b907388db9c6457afa6edbd
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
| -rw-r--r-- | lib/sqlalchemy/engine/base.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 663482b1f..64f638a50 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1877,7 +1877,7 @@ class Connection(Connectable): ): exc_info = sys.exc_info() - is_exit_exception = not isinstance(e, Exception) + is_exit_exception = util.is_exit_exception(e) if not self._is_disconnect: self._is_disconnect = ( @@ -2325,7 +2325,6 @@ class Transaction(TransactionalContext): phase transactions may be used. """ - try: self._do_commit() finally: |
