Skip to content

gh-135557: Use atomic writes on heapq operations #135601

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 13 commits into from
Jun 21, 2025

Conversation

xuantengh
Copy link
Contributor

@xuantengh xuantengh commented Jun 17, 2025

Use atomic writes on heapq operation.

@xuantengh xuantengh requested a review from rhettinger as a code owner June 17, 2025 05:22
@xuantengh xuantengh changed the title gh-135557: Fix lock-free list access on heapq gh-135557: Use atomic writes on heapq operations Jun 17, 2025
@xuantengh
Copy link
Contributor Author

I think this could be "skip news"?

@rhettinger rhettinger removed their request for review June 17, 2025 12:51
@ZeroIntensity
Copy link
Member

I think this could be "skip news"?

This is user-facing, so this does need a news. Something like "Fix race with lists and heapq on the free threaded build" would be fine. It would also be good to get a test. (Sorry for pushing back on both your PRs!)

@ZeroIntensity ZeroIntensity added the needs backport to 3.14 bugs and security fixes label Jun 17, 2025
@xuantengh xuantengh force-pushed the heap-list-lock-free-read branch from f7fbb68 to 08770ec Compare June 17, 2025 16:16
@python-cla-bot
Copy link

python-cla-bot bot commented Jun 18, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@xuantengh xuantengh force-pushed the heap-list-lock-free-read branch from 0184b21 to 463963d Compare June 18, 2025 06:38
@xuantengh xuantengh force-pushed the heap-list-lock-free-read branch from 463963d to c49ff7d Compare June 19, 2025 00:48
@xuantengh xuantengh force-pushed the heap-list-lock-free-read branch from c49ff7d to 27d6cb6 Compare June 19, 2025 10:31
@xuantengh xuantengh force-pushed the heap-list-lock-free-read branch from 2cc859d to 8cf4794 Compare June 19, 2025 13:17
@xuantengh xuantengh force-pushed the heap-list-lock-free-read branch from 8cf4794 to 32d767f Compare June 19, 2025 13:42
@ZeroIntensity
Copy link
Member

!buildbot nogil

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @ZeroIntensity for commit a10560e 🤖

Results will be shown at:

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

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

The builders matched are:

  • ARM64 MacOS M1 NoGIL PR
  • AMD64 Windows Server 2022 NoGIL PR
  • aarch64 Fedora Rawhide NoGIL refleaks PR
  • AMD64 Fedora Rawhide NoGIL PR
  • aarch64 Fedora Rawhide NoGIL PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • AMD64 CentOS9 NoGIL Refleaks PR
  • AMD64 Fedora Rawhide NoGIL refleaks PR
  • s390x Fedora Rawhide NoGIL refleaks PR
  • PPC64LE Fedora Rawhide NoGIL PR
  • PPC64LE Fedora Rawhide NoGIL refleaks PR
  • x86-64 MacOS Intel NoGIL PR
  • AMD64 CentOS9 NoGIL PR
  • x86-64 MacOS Intel ASAN NoGIL PR
  • AMD64 Windows PGO NoGIL PR
  • s390x Fedora Rawhide NoGIL PR

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

LGTM as well, assuming buildbots pass.

@kumaraditya303 kumaraditya303 merged commit 13cac83 into python:main Jun 21, 2025
58 checks passed
@miss-islington-app
Copy link

Thanks @xuantengh for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 21, 2025
…ading (pythonGH-135601)

(cherry picked from commit 13cac833471885564cbfde72a4cbac64ade3137a)

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

bedevere-app bot commented Jun 21, 2025

GH-135787 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jun 21, 2025
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