cpython/Lib/test/test_concurrent_futures
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
..
__init__.py
executor.py gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480) 2023-09-05 17:56:30 +03:00
test_as_completed.py gh-109565: Fix concurrent.futures test_future_times_out() (#109949) 2023-09-27 08:51:44 +00:00
test_deadlock.py gh-109832: concurrent.futures test_deadlock restores sys.stderr (#109887) 2023-09-26 12:43:45 +02:00
test_future.py
test_init.py
test_process_pool.py gh-109047: concurrent.futures catches PythonFinalizationError (#109810) 2023-09-29 19:31:19 +00:00
test_shutdown.py
test_thread_pool.py
test_wait.py gh-109594: Fix concurrent.futures test_timeout() (#110018) 2023-09-28 15:21:15 +02:00
util.py