[issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread

Andrew Svetlov report at bugs.python.org
Mon Nov 29 05:47:26 EST 2021


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

Thanks for the report.

Atomic copy (`list(self.processes.values()`) should fix the bug, sure.

I doubt if writing a reliable test for this situation is possible; multithreading is hard.

I think we can accept a patch without a test but with an inline comment that describes why copy is crucial.

----------
versions: +Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43498>
_______________________________________


More information about the Python-bugs-list mailing list