Skip to content

[3.13] gh-110206: Fix multiprocessing test_notify_all (GH-130933) #130950

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

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Mar 7, 2025

The test could deadlock trying join on the worker processes due to a
combination of behaviors:

  • The use of assertReachesEventually did not ensure that workers
    actually woken.release() because the SyncManager's Semaphore does not
    implement get_value.

  • This mean that the test could finish and the variable "sleeping" would
    got out of scope and be collected. This unregisters the proxy leading
    to failures in the worker or possibly the manager.

  • The subsequent call to p.join() during cleanUp therefore never
    finished.

This takes two approaches to fix this:

  1. Use woken.acquire() to ensure that the workers actually finish
    calling woken.release()

  2. At the end of the test, wait until the workers are finished, while cond,
    sleeping, and woken are still valid.
    (cherry picked from commit c476410)

Co-authored-by: Sam Gross [email protected]

The test could deadlock trying join on the worker processes due to a
combination of behaviors:

* The use of `assertReachesEventually` did not ensure that workers
  actually woken.release() because the SyncManager's Semaphore does not
  implement get_value.

* This mean that the test could finish and the variable "sleeping" would
  got out of scope and be collected. This unregisters the proxy leading
  to failures in the worker or possibly the manager.

* The subsequent call to `p.join()` during cleanUp therefore never
  finished.

This takes two approaches to fix this:

1) Use woken.acquire() to ensure that the workers actually finish
   calling woken.release()

2) At the end of the test, wait until the workers are finished, while `cond`,
   `sleeping`, and `woken` are still valid.
(cherry picked from commit c476410)

Co-authored-by: Sam Gross <[email protected]>
@colesbury
Copy link
Contributor

!buildbot refleaks

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 5113e1e 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F130950%2Fmerge

The command will test the builders whose names match following regular expression: refleaks

The builders matched are:

  • AMD64 CentOS9 Refleaks PR
  • aarch64 Fedora Stable Refleaks PR
  • PPC64LE Fedora Rawhide Refleaks PR
  • AMD64 Windows11 Refleaks PR
  • PPC64LE Fedora Rawhide NoGIL refleaks PR
  • aarch64 Fedora Rawhide NoGIL refleaks PR
  • AMD64 RHEL8 Refleaks PR
  • AMD64 CentOS9 NoGIL Refleaks PR
  • aarch64 CentOS9 Refleaks PR
  • PPC64LE Fedora Stable Refleaks PR
  • AMD64 Fedora Rawhide Refleaks PR
  • aarch64 RHEL8 Refleaks PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • PPC64LE CentOS9 Refleaks PR
  • aarch64 Fedora Rawhide Refleaks PR
  • PPC64LE RHEL8 Refleaks PR
  • s390x RHEL8 Refleaks PR
  • AMD64 Fedora Stable Refleaks PR
  • AMD64 Fedora Rawhide NoGIL refleaks PR
  • s390x RHEL9 Refleaks PR
  • AMD64 FreeBSD Refleaks PR

@colesbury colesbury merged commit 94b94d0 into python:3.13 Mar 7, 2025
51 of 52 checks passed
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.

3 participants