]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Mutex the declarative scan/map process against configure_mappers()
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 16 May 2019 15:26:04 +0000 (11:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 16 May 2019 15:28:44 +0000 (11:28 -0400)
commit5039c6f01d0bd1f58f950e80cddf7472444a70a4
treea21d629a13ef4d0f7a5129cd9fdc5f6164bfbd1e
parent89e6beaf46ebdd626e292eb20f7b6ae0c3a9ae5c
Mutex the declarative scan/map process against configure_mappers()

Applied the mapper "configure mutex" against the declarative class mapping
process, to guard against the race which can occur if mappers are used
while dynamic module import schemes are still in the process of configuring
mappers for related classes.  This does not guard against all possible race
conditions, such as if the concurrent import has not yet encountered the
dependent classes as of yet, however it guards against as much as possible
within the SQLAlchemy declarative process.

Fixes: #4686
Change-Id: I0349036b8078bd42265ab40862cfbfe5bf9d5b44
doc/build/changelog/unreleased_13/4686.rst [new file with mode: 0644]
lib/sqlalchemy/ext/declarative/base.py
test/ext/declarative/test_concurrency.py [new file with mode: 0644]