Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.11] gh-107219: Fix concurrent.futures terminate_broken() (GH-109244) #109255

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Sep 11, 2023

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 a9b1f84)

Co-authored-by: Victor Stinner [email protected]

…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 a9b1f84)

Co-authored-by: Victor Stinner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants