]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
dont use uninstrument event to dispose registry entry
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 28 Sep 2020 02:40:09 +0000 (22:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 28 Sep 2020 03:31:12 +0000 (23:31 -0400)
commitcda023bbe391d175c80c4d82196538b42575d937
treec8f1fd5f587d3616acef3e42cd48d0dc60026e0b
parentffafbd4b9657a4ee8bec57c0861414144f37bdc5
dont use uninstrument event to dispose registry entry

since 450f5c0d6519a439f4025c3892fe4c we've been seeing
errors during the uninstrument_class event where first
we saw an internal weakref being collected earlier than seen,
then fixing that we saw the listener collection changing during
iteration for similar reasons.

we would assume the issue is because of the interaction between
mapper / instrumentation/ registry during a test teardown
and the usage of the uninstrument_class event within this
interaction.   this interaction is too fundamental to be
relying upon this event in any case and when I wrote this
new code i was planning on changing that part in any case,
I just forgot.

Change-Id: I15744e01bb4d3349bfd529593ebd23eae658eaab
lib/sqlalchemy/orm/__init__.py
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/orm/decl_base.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/mapper.py