]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Invalidate on failed connect handler
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 28 Mar 2018 15:58:47 +0000 (11:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 28 Mar 2018 20:58:14 +0000 (16:58 -0400)
commit967998f301d96340d4c791130c312fe7c4d6e1f4
tree1347c5a875ba179a0face2a512e2e46306529a18
parentfe67e511887dac86dbd152e5c0c131c575e42479
Invalidate on failed connect handler

Fixed bug in connection pool where a connection could be present in the
pool without all of its "connect" event handlers called, if a previous
"connect" handler threw an exception; note that the dialects themselves
have connect handlers that emit SQL, such as those which set transaction
isolation, which can fail if the database is in a non-available state, but
still allows a connection.  The connection is now invalidated first if any
of the connect handlers fail.

Change-Id: I61d6f4827a98ab8455f1c3e1c55d046eeccec09a
Fixes: #4225
(cherry picked from commit c5437296713288cbfcd323032ca48a75a97e10e5)
doc/build/changelog/unreleased_12/4225.rst [new file with mode: 0644]
lib/sqlalchemy/pool.py
test/engine/test_pool.py