Skip to content

gh-151593: Avoid deadlock in insert_split_key(). - #152133

Closed
nascheme wants to merge 2 commits into
python:mainfrom
nascheme:gh-151593-insert-split-key
Closed

gh-151593: Avoid deadlock in insert_split_key().#152133
nascheme wants to merge 2 commits into
python:mainfrom
nascheme:gh-151593-insert-split-key

Conversation

@nascheme

@naschemenascheme commented Jun 24, 2026

Copy link
Copy Markdown
Member

We must not acquire other locks while holding the LOCK_KEYS() mutex. This issue is fixed by calling PyType_Modifed() after releasing the mutex.

Note: this PR was assisted by Claude Opus 4.8.

We must not acquire other locks while holding the LOCK_KEYS() mutex. This
issue is fixed by calling PyType_Modifed() after releasing the mutex.
@nascheme
nascheme marked this pull request as ready for review June 25, 2026 01:23
@nascheme

Copy link
Copy Markdown
MemberAuthor

This fixes the deadlock but it introduces a correctness issue: a thread can read a stale class attribute/method back from an instance attribute it just stored. The only solution I can think of for this now is to revert GH-150489. :-(

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@nascheme