Skip to content

Fix hashtable insertion race. (Free-Threaded)#1327

Open
Vizonex wants to merge 5 commits intoaio-libs:masterfrom
Vizonex:critical-sections
Open

Fix hashtable insertion race. (Free-Threaded)#1327
Vizonex wants to merge 5 commits intoaio-libs:masterfrom
Vizonex:critical-sections

Conversation

@Vizonex
Copy link
Copy Markdown
Member

@Vizonex Vizonex commented Apr 28, 2026

What do these changes do?

This change comes related to _md_add_with_hash_steal_refs Which mentions a possible hashtable insertion race in free-threaded mode.

Are there changes in behavior for the user?

this should not affect the pure python version of multidict only the C version.

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@Vizonex Vizonex requested a review from asvetlov as a code owner April 28, 2026 19:50
@Vizonex Vizonex requested a review from webknjaz as a code owner April 28, 2026 19:51
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Apr 28, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 28, 2026

Merging this PR will not alter performance

✅ 245 untouched benchmarks


Comparing Vizonex:critical-sections (a0a7410) with master (4122516)

Open in CodSpeed

@Vizonex
Copy link
Copy Markdown
Member Author

Vizonex commented Apr 28, 2026

Would be nice if we made a label for free-threaded pull requests but I don't know if that will be necessary yet.

@Vizonex
Copy link
Copy Markdown
Member Author

Vizonex commented Apr 28, 2026

3.13t plans to be removed by #1326 so I'm not so concerned if 3.13t fails.

@webknjaz webknjaz added the free-threading FT-related discussion, issue or PR label Apr 29, 2026
@webknjaz
Copy link
Copy Markdown
Member

Labels are cheap, I've added one.

Comment thread CHANGES/1327.bugfix.rst
import sysconfig
import textwrap

FREETHREADED = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not convinced we should gate on this here.

cc @Dreamsorcerer

Vizonex and others added 2 commits April 29, 2026 10:02
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR free-threading FT-related discussion, issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants