]> 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:17:45 +0000 (16:17 -0400)
commit00261d25694fa88c6f79739c7c70306a1b627342
treeb7ba4882f0dca4786512cb957335c831b360cd3e
parentb2c4333d5b158f73bb3afaf979e0e379f828b3b5
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
(cherry picked from commit dada909a1009ad2f77063752ac8c13a7808dd916)
doc/build/changelog/unreleased_12/4252.rst [new file with mode: 0644]
lib/sqlalchemy/pool.py
test/engine/test_pool.py