Skip to content

gh-117657: Fix race involving immortalizing objects - #119927

Merged
colesbury merged 4 commits into
python:mainfrom
colesbury:gh-117657-immortalize
Jun 3, 2024
Merged

colesbury merged 4 commits into
python:mainfrom
colesbury:gh-117657-immortalize

Conversation

@colesbury

@colesbury colesbury commented Jun 1, 2024 •

Copy link
Copy Markdown
Contributor

The free-threaded build currently immortalizes objects that use deferred reference counting (see gh-117783). This typically happens once the first non-main thread is created, but the behavior can be suppressed for tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the behavior is suppressed.

The free-threaded build currently immortalizes objects that use deferred
reference counting (see pythongh-117783). This typically happens once the
first non-main thread is created, but the behavior can be suppressed for
tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the
behavior is suppressed.
@colesbury

Copy link
Copy Markdown
Contributor Author

!buildbot nogil

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 45afd9d 🤖

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

The builders matched are:

  • PPC64LE Fedora Rawhide NoGIL refleaks PR
  • aarch64 Fedora Rawhide NoGIL refleaks PR
  • x86-64 MacOS Intel NoGIL PR
  • aarch64 Fedora Rawhide NoGIL PR
  • AMD64 Fedora Rawhide NoGIL refleaks PR
  • x86-64 MacOS Intel ASAN NoGIL PR
  • AMD64 Ubuntu NoGIL Refleaks PR
  • PPC64LE Fedora Rawhide NoGIL PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • AMD64 Fedora Rawhide NoGIL PR
  • ARM64 MacOS M1 NoGIL PR
  • AMD64 Windows Server 2022 NoGIL PR
  • AMD64 Ubuntu NoGIL PR
@colesbury
colesbury marked this pull request as ready for review June 2, 2024 15:01
@colesbury
colesbury requested review from DinoV and Fidget-Spinner June 2, 2024 15:01

@DinoV DinoV left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@colesbury
colesbury enabled auto-merge (squash) June 3, 2024 20:55
@colesbury
colesbury merged commit 47fb432 into python:main Jun 3, 2024
@miss-islington-app

Copy link
Copy Markdown

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

@miss-islington-app

Copy link
Copy Markdown

Sorry, @colesbury, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 47fb4327b5c405da6df066dcaa01b7c1aefab313 3.13
colesbury added a commit to colesbury/cpython that referenced this pull request Jun 3, 2024
)

The free-threaded build currently immortalizes objects that use deferred
reference counting (see pythongh-117783). This typically happens once the
first non-main thread is created, but the behavior can be suppressed for
tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the
behavior is suppressed.

(cherry picked from commit 47fb432)
@bedevere-app

bedevere-app Bot commented Jun 3, 2024

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 3, 2024
@colesbury
colesbury deleted the gh-117657-immortalize branch June 3, 2024 22:02
colesbury added a commit that referenced this pull request Jun 3, 2024
#120005)

The free-threaded build currently immortalizes objects that use deferred
reference counting (see gh-117783). This typically happens once the
first non-main thread is created, but the behavior can be suppressed for
tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the
behavior is suppressed.

(cherry picked from commit 47fb432)
mliezun pushed a commit to mliezun/cpython that referenced this pull request Jun 3, 2024
)

The free-threaded build currently immortalizes objects that use deferred
reference counting (see pythongh-117783). This typically happens once the
first non-main thread is created, but the behavior can be suppressed for
tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the
behavior is suppressed.
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
)

The free-threaded build currently immortalizes objects that use deferred
reference counting (see pythongh-117783). This typically happens once the
first non-main thread is created, but the behavior can be suppressed for
tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the
behavior is suppressed.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
)

The free-threaded build currently immortalizes objects that use deferred
reference counting (see pythongh-117783). This typically happens once the
first non-main thread is created, but the behavior can be suppressed for
tests, in subinterpreters, or during a compile() call.

This fixes a race condition involving the tracking of whether the
behavior is suppressed.
@colesbury colesbury removed their assignment Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants