]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Prevent double-checkins and guard during reset-on-return invalidations
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 15 May 2018 20:15:51 +0000 (16:15 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 15 May 2018 20:16:59 +0000 (16:16 -0400)
commitdada909a1009ad2f77063752ac8c13a7808dd916
tree40c66fa8ec354bf2a8e3148db3ecfaf38e54a38a
parent432d24ab1aac04a8ec881919964ff47ad8154659
Prevent double-checkins and guard during reset-on-return invalidations

Fixed connection pool issue whereby if a disconnection error were raised
during the connection pool's "reset on return" sequence in conjunction with
an explicit transaction opened against the enclosing :class:`.Connection`
object (such as from calling :meth:`.Session.close` without a rollback or
commit, or calling :meth:`.Connection.close` without first closing a
transaction declared with :meth:`.Connection.begin`), a double-checkin would
result, which could then lead towards concurrent checkouts of the same
connection. The double-checkin condition is now prevented overall by an
assertion, as well as the specific double-checkin scenario has been
fixed.

Change-Id: If5bb6941e36326846b14918c33ebfdd5604f642e
Fixes: #4252
doc/build/changelog/unreleased_12/4252.rst [new file with mode: 0644]
lib/sqlalchemy/pool.py
test/engine/test_pool.py