cpython/Lib/concurrent/futures
Miss Islington (bot) 2f8c80f531
[3.11] gh-107219: Fix concurrent.futures terminate_broken() (GH-109244) (#109255)
gh-107219: Fix concurrent.futures terminate_broken() (GH-109244)

Fix a race condition in concurrent.futures. When a process in the
process pool was terminated abruptly (while the future was running or
pending), close the connection write end. If the call queue is
blocked on sending bytes to a worker process, closing the connection
write end interrupts the send, so the queue can be closed.

Changes:

* _ExecutorManagerThread.terminate_broken() now closes
  call_queue._writer.
* multiprocessing PipeConnection.close() now interrupts
  WaitForMultipleObjects() in _send_bytes() by cancelling the
  overlapped operation.
(cherry picked from commit a9b1f84790)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-11 08:52:17 +00:00
..
__init__.py bpo-46522: fix concurrent.futures and io AttributeError messages (GH-30887) 2022-02-23 02:25:00 +02:00
_base.py gh-95166: cancel map waited on future on timeout (GH-95169) (GH-95364) 2022-07-28 12:56:21 +02:00
process.py [3.11] gh-107219: Fix concurrent.futures terminate_broken() (GH-109244) (#109255) 2023-09-11 08:52:17 +00:00
thread.py bpo-45021: Fix a hang in forked children (GH-28007) 2021-09-20 11:30:19 -07:00