Skip to content

[3.15] gh-158197: Fix split dict iteration during concurrent deletion (gh-158686) - #159953

Merged
JelleZijlstra merged 1 commit into
python:3.15from
miss-islington:backport-4bb1dad-3.15
Oct 21, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.15from
miss-islington:backport-4bb1dad-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Read insertion order from the iterator's captured values snapshot instead
of re-reading ma_values and asserting against a concurrently changing
size. Retry under the dictionary lock when a value slot has been cleared.

Make insertion-order writes atomic and publish size changes with release
stores, pairing with the iterator's size load. Keep order-byte accesses
relaxed. Add _Py_atomic_store_uint8_release() and
FT_ATOMIC_STORE_UINT8_RELEASE() for this.
(cherry picked from commit 4bb1dad)

Co-authored-by: Neil Schemenauer nas-github@arctrix.com

…ythongh-158686)

Read insertion order from the iterator's captured values snapshot instead
of re-reading ma_values and asserting against a concurrently changing
size. Retry under the dictionary lock when a value slot has been cleared.

Make insertion-order writes atomic and publish size changes with release
stores, pairing with the iterator's size load. Keep order-byte accesses
relaxed. Add _Py_atomic_store_uint8_release() and
FT_ATOMIC_STORE_UINT8_RELEASE() for this.
(cherry picked from commit 4bb1dad)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
@bedevere-app bedevere-app Bot added topic-free-threading type-bug An unexpected behavior, bug, or error labels Oct 20, 2026
@JelleZijlstra
JelleZijlstra merged commit 74a2677 into python:3.15 Oct 21, 2026
60 checks passed
@miss-islington
miss-islington deleted the backport-4bb1dad-3.15 branch October 21, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-free-threading type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants