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

aio-libs / multidict / 36311301009
86%

Build:
DEFAULT BRANCH: master
Ran 27 Sep 2026 10:04AM UTC
Jobs 1
Files 45
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

27 Sep 2026 10:03AM UTC coverage: 87.209%. Remained the same
36311301009

push

github

web-flow
Make the pure-Python version bump atomic on GIL builds (#1610)

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

## What do these changes do?

On GIL builds the pure-Python `_incr_version()` read, incremented and
stored the shared version counter across several bytecodes, so two
threads mutating different multidicts at once could be handed the same
version. The counter is now an `itertools.count`, and the GIL build
takes `next()` from it, which is a single C call. The free-threaded
build keeps `_VERSION_LOCK` around the same `next()`, since
`itertools.count` is not documented as thread-safe there.

`test_pure_python_version_thread_safety` no longer carries
`_gil_build_race_skip`. It lowers the switch interval to 1e-4 s while
its threads run, which fails reliably on PyPy before the fix. CPython
3.10 and 3.14 GIL builds never showed the race, since they only switch
threads at calls and backward jumps and the old increment had neither in
the window.

The C extension is unaffected; its counter was made atomic in #1446.

## Are there changes in behavior for the user?

No, apart from pure-Python versions no longer colliding across threads.

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

No; the change is three lines and makes the increment simpler.

## Related issue number

Related to #1605, whose pure-Python GIL-build skip in
`test_versions_unique_across_threads` can be removed once both land.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes (N/A, no documented behaviour
changed)
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` (N/A)
- [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`

Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.

<details>
<summary>Agent run details (optional, for reviewers)</summ... (continued)

781 of 1562 branches covered (50.0%)

Branch coverage included in aggregate %.

10 of 10 new or added lines in 2 files covered. (100.0%)

8423 of 8992 relevant lines covered (93.67%)

1.87 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36311301009.1 27 Sep 2026 10:04AM UTC 90
87.21
GitHub Action Run
Source Files on build 36311301009
  • Tree
  • List 45
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36311301009
  • 200e9d4b on github
  • Prev Build on master (#36311162759)
  • Next Build on master (#36312574728)
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