FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.12] gh-107219: Fix concurrent.futures terminate_broken() (GH-109244) by miss-islington · Pull Request #109254 · python/cpython · GitHub

/ cpython Public

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

Merged
Yhg1s merged 1 commit into
python:3.12from
miss-islington:backport-a9b1f84-3.12
Oct 2, 2023
Merged

[3.12] gh-107219: Fix concurrent.futures terminate_broken() (GH-109244)#109254
Yhg1s merged 1 commit into
python:3.12from
miss-islington:backport-a9b1f84-3.12

Conversation

miss-islington commented Sep 11, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

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 vstinner@python.org

…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 <vstinner@python.org>

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, good bot.

gpshead commented Sep 12, 2023

Copy link
Copy Markdown
Member

I don't know that this strictly needs to hold up 3.12.0, it'd be fine in 3.12.1... but the issue this addresses seems to be one that causes CI testing to fail frequently on windows. so it might help unblock things anyways.

Yhg1s commented Sep 12, 2023

Copy link
Copy Markdown
Member

FYI, I'm delaying this until 3.12.1.

Yhg1s merged commit 1d8c18c into python:3.12 Oct 2, 2023
miss-islington deleted the backport-a9b1f84-3.12 branch October 2, 2023 14:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL