mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-43498: Fix dictionary iteration error in _ExecutorManagerThread (GH-24868)
(cherry picked from commit 7431448b81
)
Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
This commit is contained in:
parent
5b6aa6ce20
commit
3b9d886567
2 changed files with 3 additions and 1 deletions
|
@ -373,7 +373,7 @@ class _ExecutorManagerThread(threading.Thread):
|
||||||
assert not self.thread_wakeup._closed
|
assert not self.thread_wakeup._closed
|
||||||
wakeup_reader = self.thread_wakeup._reader
|
wakeup_reader = self.thread_wakeup._reader
|
||||||
readers = [result_reader, wakeup_reader]
|
readers = [result_reader, wakeup_reader]
|
||||||
worker_sentinels = [p.sentinel for p in self.processes.values()]
|
worker_sentinels = [p.sentinel for p in list(self.processes.values())]
|
||||||
ready = mp.connection.wait(readers + worker_sentinels)
|
ready = mp.connection.wait(readers + worker_sentinels)
|
||||||
|
|
||||||
cause = None
|
cause = None
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Avoid a possible *"RuntimeError: dictionary changed size during iteration"*
|
||||||
|
when adjusting the process count of :class:`ProcessPoolExecutor`.
|
Loading…
Add table
Add a link
Reference in a new issue