Fixed an issue where clearing of mappers during things like test suite
teardowns could cause a "dictionary changed size" warning during garbage
collection, due to iteration of a weak-referencing dictionary. A ``list()``
has been applied to prevent concurrent GC from affecting this operation.
Fixes: #6771
Change-Id: I3e1d67e978b2726a282d8b327457f2d4b239a0c6
--- /dev/null
+.. change::
+ :tags: orm, bug
+ :tickets: 6771
+
+ Fixed an issue where clearing of mappers during things like test suite
+ teardowns could cause a "dictionary changed size" warning during garbage
+ collection, due to iteration of a weak-referencing dictionary. A ``list()``
+ has been applied to prevent concurrent GC from affecting this operation.
return itertools.chain(
(
manager.mapper
- for manager in self._managers
+ for manager in list(self._managers)
if manager.is_mapped
and not manager.mapper.configured
and manager.mapper._ready_for_configure
),
(
npm
- for npm in self._non_primary_mappers
+ for npm in list(self._non_primary_mappers)
if not npm.configured and npm._ready_for_configure
),
)