cpython/Lib/multiprocessing
Miss Islington (bot) 7f5302fed4
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>
(cherry picked from commit ac10e0c932)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-15 14:26:43 -07:00
..
dummy bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
__init__.py Simplify __all__ in multiprocessing (GH-6856) 2018-07-11 19:22:28 +09:00
connection.py [3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876) 2020-03-09 14:48:03 +00:00
context.py bpo-33725: multiprocessing uses spawn by default on macOS (GH-13603) 2019-05-28 16:02:50 +02:00
forkserver.py [3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876) 2020-03-09 14:48:03 +00:00
heap.py bpo-32759: Free unused arenas in multiprocessing.heap (GH-5827) 2018-04-09 17:37:55 +02:00
managers.py [3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876) 2020-03-09 14:48:03 +00:00
pool.py bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009) 2020-03-15 14:26:43 -07:00
popen_fork.py bpo-36888: Add multiprocessing.parent_process() (GH-13247) 2019-05-20 21:37:05 +02:00
popen_forkserver.py bpo-36888: Add multiprocessing.parent_process() (GH-13247) 2019-05-20 21:37:05 +02:00
popen_spawn_posix.py bpo-36888: Add multiprocessing.parent_process() (GH-13247) 2019-05-20 21:37:05 +02:00
popen_spawn_win32.py bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual environment (GH-16098) 2019-09-13 09:59:11 -07:00
process.py bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088) 2019-11-19 12:11:20 -08:00
queues.py bpo-22872: multiprocessing.Queue's put() and get() now raise ValueError if the queue is closed. (GH-9010) 2018-10-13 12:26:09 +03:00
reduction.py bpo-34521: Fix tests in test_multiprocessing_spawn to use correctly CMSG_SPACE (GH-9613) 2018-09-28 02:51:05 -07:00
resource_sharer.py bpo-36766: Typos in docs and code comments (GH-13116) 2019-05-06 14:57:17 -04:00
resource_tracker.py bpo-38546: multiprocessing tests stop the resource tracker (GH-17641) (GH-17647) 2019-12-18 10:11:05 +01:00
shared_memory.py bpo-36867: Make semaphore_tracker track other system resources (GH-13222) 2019-05-10 22:59:08 +02:00
sharedctypes.py bpo-32157: Removed explicit quotes around %r and {!r}. (#4582) 2017-11-28 22:54:42 +02:00
spawn.py bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158) 2020-01-28 02:52:47 -08:00
synchronize.py bpo-36867: Make semaphore_tracker track other system resources (GH-13222) 2019-05-10 22:59:08 +02:00
util.py [3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876) 2020-03-09 14:48:03 +00:00