cpython/Lib/multiprocessing
Batuhan Taşkaya ac10e0c932
bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009)
When the pull is not used via the context manager or terminate() is called, there is a system in multiprocessing.util that handles finalization of all pools via an atexit handler (the Finalize) class. This class registers the _terminate_pool handler in the registry of finalizers of the module, and that registry is called on interpreter exit via _exit_function. The problem is that the "happy" path with the context manager or manual call to finalize() does some extra steps that _terminate_pool does not. The step that is not executed when the atexit() handler calls _terminate_pool is pinging the _change_notifier queue to unblock the maintenance threads.

This commit moves the notification to the _terminate_pool function so is called from both code paths.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-15 19:45:56 +00:00
..
dummy
__init__.py
connection.py bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) 2020-03-09 13:48:01 +00:00
context.py
forkserver.py bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) 2020-03-09 13:48:01 +00:00
heap.py
managers.py bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) 2020-03-09 13:48:01 +00:00
pool.py bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009) 2020-03-15 19:45:56 +00:00
popen_fork.py Remove binding of captured exceptions when not used to reduce the chances of creating cycles (GH-17246) 2019-11-19 21:34:03 +00:00
popen_forkserver.py
popen_spawn_posix.py
popen_spawn_win32.py bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual environment (GH-16098) 2019-09-13 09:40:19 -07:00
process.py bpo-35727: Use exit code 0 on sys.exit() in multiprocessing.Process. (GH-11538) 2020-02-21 10:33:04 +01:00
queues.py
reduction.py
resource_sharer.py
resource_tracker.py bpo-38546: multiprocessing tests stop the resource tracker (GH-17641) 2019-12-17 18:37:26 +01:00
shared_memory.py
sharedctypes.py
spawn.py bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158) 2020-01-28 21:34:23 +11:00
synchronize.py
util.py bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) 2020-03-09 13:48:01 +00:00