]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add new "exec_once_unless_exception" system; apply to dialect.initialize
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 16 Aug 2019 22:07:06 +0000 (18:07 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Aug 2019 14:41:52 +0000 (10:41 -0400)
commit2051fa2ce9e724e6e77e19067d27d2660e7cd74a
tree5cbff495b520116f4b8bfa35683ef4c1bd681785
parentd1948bc69bd0d26fbff77d7525ef899a2a9a580d
Add new "exec_once_unless_exception" system; apply to dialect.initialize

Fixed an issue whereby if the dialect "initialize" process which occurs on
first connect would encounter an unexpected exception, the initialize
process would fail to complete and then no longer attempt on subsequent
connection attempts, leaving the dialect in an un-initialized, or partially
initialized state, within the scope of parameters that need to be
established based on inspection of a live connection.   The "invoke once"
logic in the event system has been reworked to accommodate for this
occurrence using new, private API features that establish an "exec once"
hook that will continue to allow the initializer to fire off on subsequent
connections, until it completes without raising an exception. This does not
impact the behavior of the existing ``once=True`` flag within the event
system.

Fixes: #4807
Change-Id: Iec32999b61b6af4b38b6719e0c2651454619078c
doc/build/changelog/unreleased_13/4807.rst [new file with mode: 0644]
lib/sqlalchemy/engine/create.py
lib/sqlalchemy/event/attr.py
lib/sqlalchemy/event/registry.py
lib/sqlalchemy/pool/base.py
lib/sqlalchemy/util/langhelpers.py
test/base/test_events.py
test/engine/test_reconnect.py