]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Run handle_error for any exceptions raised in execute_context()
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 4 Mar 2020 00:15:55 +0000 (19:15 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 4 Mar 2020 00:56:51 +0000 (19:56 -0500)
commit47abc46efe92d06b7ee8ded59d528f1b731ba492
tree2b23551019946b632d995c5539302b9e9472ad22
parent6989317450f3ff2cf3f2b05176c2afa7e55d6ed5
Run handle_error for any exceptions raised in execute_context()

Observing a SQLite connection/cursor being hung on
test_resultset -> PositionalTextTest -> test_dupe_col_obj.
this uses connectionless execution and the result object
fails to be constructed.  When that happens, there is no path
for the cursor or connection to be closed / released.
Recent changes with the exception assertions in #4849 seem to
be causing a cycle to last a little longer than usual which
is exposing this issue for one particular test on SQLite.

As we want to get rid of weakref cleanup, evaluate
why we dont have handle_dbapi_exception for this whole
block, as after_cursor_execute can raise, result construction
can raise, autocommit can raise, close can raise, there
does not seem to be a reason these things should be outside
of the block that gets cleaned up.

Fixes: #5182
Change-Id: I640ac55e8c5f39d287f779fbb5dc0ab727218ca3
(cherry picked from commit 4cd33f18a21d9e33b37ef7163822c327453d1e62)
doc/build/changelog/unreleased_13/5182.rst [new file with mode: 0644]
lib/sqlalchemy/engine/base.py
test/engine/test_execute.py