• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aio-libs / multidict / 34782403362
87%

Build:
DEFAULT BRANCH: master
Ran 13 Sep 2026 08:59PM UTC
Jobs 1
Files 33
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Sep 2026 08:58PM UTC coverage: 85.838% (+0.05%) from 85.789%
34782403362

push

github

web-flow
Fix a data race on entry->hash between getall()/update() and lock-free reads (#1448)

<!-- Thank you for your contribution! -->

## What do these changes do?

`getall()`/`popall()` (via `md_find_next()`/`md_finder_cleanup()`) and
`update()`/`extend()`/`merge()` (via `md_post_update()`) mark and unmark
a matching entry's hash while holding `self`'s critical section. That
excludes other mutators but not a lock-free reader: `__contains__` and
`get()`/`getone()`/`__getitem__` load the same field with an atomic op
and no lock at all. The mark/unmark writes were plain, non-atomic
stores, racing that atomic load under the free-threaded build. This
routes them through the existing `_md_entry_store_hash()` helper,
matching the pattern `_md_replace()`/`_md_update()` already use for the
same mark bit.

Note this is unrelated to and much cheaper than the approach tried in
#1442 (which replaced the marking scheme entirely and was withdrawn for
a large performance regression): the fix here keeps the existing
in-place marking and only makes the one racy write atomic, at the cost
of a relaxed atomic store in place of a plain one.

## Are there changes in behavior for the user?

No. This only affects the free-threaded build's internal memory-model
correctness; there is no change to observable behavior.

## Is it a substantial burden for the maintainers to support this?

No, it's a small, self-contained fix mirroring the existing atomic-op
pattern already used elsewhere in `hashtable.h`.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` (N/A: no `CONTRIBUTORS.txt` in this repo)
- [x] Add a new news fragment into the `CHANGES/` folder
- [x] `make doc-spelling` passes and any new technical words are added
to `docs/spelling_wordlist.txt`

<details>
<summary>Agent run details (opt... (continued)

663 of 1326 branches covered (50.0%)

Branch coverage included in aggregate %.

22 of 22 new or added lines in 1 file covered. (100.0%)

4768 of 5001 relevant lines covered (95.34%)

1.91 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 34782403362.1 13 Sep 2026 08:59PM UTC 66
85.84
GitHub Action Run
Source Files on build 34782403362
  • Tree
  • List 33
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #34782403362
  • 80632ebb on github
  • Prev Build on master (#34777395901)
  • Next Build on master (#34788665032)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc