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

aio-libs / multidict / 35997132739
87%

Build:
DEFAULT BRANCH: master
Ran 24 Sep 2026 12:08PM UTC
Jobs 1
Files 43
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

24 Sep 2026 12:07PM UTC coverage: 87.585% (+0.04%) from 87.545%
35997132739

push

github

web-flow
Retry the retired-table drain after pushing tables back (#1565)

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

## What do these changes do?

On the free-threaded build, a drain that reads the active-readers gate
as
nonzero pushes the tables it holds back onto `md->retired` and leaves
them to
the reader the gate showed it. That reader can have run its own drain
already,
between `_md_drain_retired_slow()`'s exchange and its push-back, and
found the
list empty; nothing is then left to free those tables. They sit there
until
the multidict is next used, and if it is dropped instead, the references
their
entries own are never released. Rereading the gate after the push-back
tells
the two apart: nonzero means the reader it sees decrements after that
read,
hence after the push-back, so its own drain observes the tables, while
zero
means nothing else will and another pass is what frees them.

This is the window #1555 was reached through, so it is an alternative
fix for
that leak as well as a fix for tables sitting on the list longer than
they
should. It is complementary to #1562 rather than a replacement: this
closes
the window, #1562 backstops the invariant at teardown whatever the drain
does,
and the two do not conflict.

## Are there changes in behavior for the user?

No, other than retired tables being freed when they should be. C
extension
only; the pure-Python implementation has no retirement scheme. Builds
with the
GIL enabled emit byte-identical code.

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

No. One reread of an atomic already being read on that path, on a branch
taken
only when a drain finds a reader in flight.

## Related issue number

Refs #1555

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes N/A, no user-facing API changed
- [x] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` N/A, this repo has no such file
- [x... (continued)

775 of 1550 branches covered (50.0%)

Branch coverage included in aggregate %.

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

7571 of 7979 relevant lines covered (94.89%)

1.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 35997132739.1 24 Sep 2026 12:08PM UTC 86
87.58
GitHub Action Run
Source Files on build 35997132739
  • Tree
  • List 43
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #35997132739
  • 62df00f1 on github
  • Prev Build on master (#35996458823)
  • Next Build on master (#36000064934)
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