cpython/Lib/multiprocessing
Victor Stinner 6351842121
gh-109047: concurrent.futures catches PythonFinalizationError (#109810)
concurrent.futures: The *executor manager thread* now catches
exceptions when adding an item to the *call queue*. During Python
finalization, creating a new thread can now raise RuntimeError. Catch
the exception and call terminate_broken() in this case.

Add test_python_finalization_error() to test_concurrent_futures.

concurrent.futures._ExecutorManagerThread changes:

* terminate_broken() no longer calls shutdown_workers() since the
  call queue is no longer working anymore (read and write ends of
  the queue pipe are closed).
* terminate_broken() now terminates child processes, not only
  wait until they complete.
* _ExecutorManagerThread.terminate_broken() now holds shutdown_lock
  to prevent race conditons with ProcessPoolExecutor.submit().

multiprocessing.Queue changes:

* Add _terminate_broken() method.
* _start_thread() sets _thread to None on exception to prevent
  leaking "dangling threads" even if the thread was not started
  yet.
2023-09-29 19:31:19 +00:00
..
dummy
__init__.py
connection.py gh-109370: Fix unexpected traceback output in test_concurrent_futures (GH-109780) 2023-09-26 10:06:07 +03:00
context.py gh-84559: Remove the new multiprocessing warning, too disruptive. (#101551) 2023-02-03 15:20:46 -08:00
forkserver.py gh-107963: Fix set_forkserver_preload to check the type of given list (#107965) 2023-08-15 15:58:12 +02:00
heap.py
managers.py gh-106558: break ref cycles through exceptions in multiprocessing manager (#106559) 2023-08-11 17:44:18 +00:00
pool.py Fix typo in exception message in multiprocessing.pool (#99900) 2022-11-30 20:57:28 +05:30
popen_fork.py
popen_forkserver.py
popen_spawn_posix.py
popen_spawn_win32.py gh-110036: multiprocessing Popen.terminate() catches PermissionError (#110037) 2023-09-29 02:41:12 +02:00
process.py gh-104536: Improve multiprocessing.process._cleanup logic (#104537) 2023-05-22 03:48:57 +00:00
queues.py gh-109047: concurrent.futures catches PythonFinalizationError (#109810) 2023-09-29 19:31:19 +00:00
reduction.py
resource_sharer.py
resource_tracker.py gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (#109629) 2023-09-26 13:57:25 +02:00
shared_memory.py bpo-40882: Fix a memory leak in SharedMemory on Windows (GH-20684) 2022-11-25 17:39:48 +00:00
sharedctypes.py
spawn.py More actionable error message when spawn is incorrectly used. (#102203) 2023-08-15 18:03:45 -07:00
synchronize.py gh-108520: Fix bad fork detection in nested multiprocessing use case (#108568) 2023-08-30 17:07:41 +00:00
util.py gh-109461: Update logging module lock to use context manager (#109462) 2023-09-27 18:26:41 +02:00