Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Mar 4, 2025

Replace a sleep with an event: sleep is not a reliable synchronization primitive.

Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
@vstinner
Copy link
Member Author

vstinner commented Mar 4, 2025

On Windows, I can easily reproduce the issue with: python -m test test_multiprocessing_spawn.test_threads -m test_active_children -v -F -j20. I reproduce the issue in a few seconds.

With this change, I cannot reproduce the issue anymore. I ran the test for 3 minutes (565 iterations).

@vstinner vstinner enabled auto-merge (squash) March 4, 2025 17:01
@vstinner vstinner merged commit 3dd3675 into python:main Mar 4, 2025
52 checks passed
@vstinner vstinner deleted the test_active_children branch March 4, 2025 17:05
@miss-islington-app
Copy link

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 4, 2025
…-130837)

Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
(cherry picked from commit 3dd3675)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Mar 4, 2025

GH-130845 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 4, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 4, 2025
…-130837)

Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
(cherry picked from commit 3dd3675)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Mar 4, 2025

GH-130846 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Mar 4, 2025
vstinner added a commit that referenced this pull request Mar 4, 2025
…) (#130846)

gh-130730: Fix multiprocessing test_active_children() (GH-130837)

Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
(cherry picked from commit 3dd3675)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit that referenced this pull request Mar 4, 2025
…) (#130845)

gh-130730: Fix multiprocessing test_active_children() (GH-130837)

Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
(cherry picked from commit 3dd3675)

Co-authored-by: Victor Stinner <[email protected]>
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…30837)

Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants