summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-12-12 13:47:27 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-12-13 09:45:22 -0500
commit6221c53ca86787e2de55de8b203658adcdf3b8a1 (patch)
tree5d3713a2aca2540bd4fde5320b04d40ac7b25df9 /lib/sqlalchemy/sql/compiler.py
parente0eea374c2df82f879d69b99ba2230c743bbae27 (diff)
downloadsqlalchemy-6221c53ca86787e2de55de8b203658adcdf3b8a1.tar.gz
catch all BaseException in pool and revert failed checkouts
Fixed a long-standing race condition in the connection pool which could occur under eventlet/gevent monkeypatching schemes in conjunction with the use of eventlet/gevent ``Timeout`` conditions, where a connection pool checkout that's interrupted due to the timeout would fail to clean up the failed state, causing the underlying connection record and sometimes the database connection itself to "leak", leaving the pool in an invalid state with unreachable entries. This issue was first identified and fixed in SQLAlchemy 1.2 for :ticket:`4225`, however the failure modes detected in that fix failed to accommodate for ``BaseException``, rather than ``Exception``, which prevented eventlet/gevent ``Timeout`` from being caught. In addition, a block within initial pool connect has also been identified and hardened with a ``BaseException`` -> "clean failed connect" block to accommodate for the same condition in this location. Big thanks to Github user @niklaus for their tenacious efforts in identifying and describing this intricate issue. Fixes: #8974 Change-Id: I95a0e1f080d0cee6f1a66977432a586fdf87f686
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
0 files changed, 0 insertions, 0 deletions