GeezerVison is showing github.com — gh-157841: Synchronize functools.partial state access by mpage · Pull Request #160480 · python/cpython
Conversation
mpage
commented
Oct 23, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Acquire coherent strong-reference snapshots under the partial object lock for calls, repr, reduce, and nested-partial construction. Publish replacement state atomically, release displaced references after publication, and retire replaced instance dictionaries through QSBR. Keep free-threaded vectorcall dispatch immutable after construction.
Add concurrent state/coherence coverage, placeholder-aware flattening tests, and regressions for reentrant keyword merging and finalizers.
Authored with AI and reviewed by me.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Acquire coherent strong-reference snapshots under the partial object lock for
calls, repr, reduce, and nested-partial construction. Publish replacement state
atomically, release displaced references after publication, and retire replaced
instance dictionaries through QSBR. Keep free-threaded vectorcall dispatch
immutable after construction.
Add concurrent state/coherence coverage, placeholder-aware flattening tests, and
regressions for reentrant keyword merging and finalizers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran the reproducer from the issue against this PR (cae9916) and its parent (738d055). macOS arm64, --disable-gil builds, 4 s per run.
Release builds, PYTHONMALLOC=debug, 10 runs per mode:
mode 738d055 cae9916
ro 10/10 ok 10/10 ok
rw 0/10 (segv) 10/10 ok
ww 0/10 (segv) 10/10 ok
cw 0/10 (segv) 10/10 ok
TSan builds (--with-thread-sanitizer, in-tree FT suppressions file which has no active entries, halt_on_error=0), 3 runs per mode:
mode 738d055 cae9916
ro no reports no reports
rw reports in 3/3 runs no reports
ww reports in 3/3 runs no reports
cw reports in 3/3 runs no reports
The parent had 6-21 data race warnings per rw/ww/cw run, with top frames in partial_setstate and partial_setvectorcall; those runs ended in SIGABRT, SIGKILL or a 300 s timeout. All 12 PR TSan runs exited 0 with no warnings. No crashes or TSan reports with the PR in these runs.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
rhettinger
Awaiting requested review from rhettinger
rhettinger will be requested when the pull request is marked ready for review
rhettinger is a code owner
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|