Skip to content

gh-151728: Partially revert "Clear the typing caches at interpreter shutdown (GH-154858)" - #154992

Merged
encukou merged 1 commit into
python:mainfrom
encukou:revert-22a6c51
Jul 31, 2026
Merged

gh-151728: Partially revert "Clear the typing caches at interpreter shutdown (GH-154858)"#154992
encukou merged 1 commit into
python:mainfrom
encukou:revert-22a6c51

Conversation

@encukou

@encukou encukou commented Jul 31, 2026

Copy link
Copy Markdown
Member

Unfortunately, adding the atexit function causes reference leak tests to fail.
Broken Tier 1 buildbots, revert or fix immediatelly. I currently don't have time to investigate.

This only reverts the atexit registration: it leaves the _clear_caches function, to simplify the regrtest utils code a bit.

cc @wjakob

…own (pythonGH-154858)"

Unfortunately, this change causes reference leak tests to fail.
@wjakob

wjakob commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@encukou Can you tell me where those leak test failures can be seen? The original PR afaik had no test failures.

@encukou

encukou commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

Refleak tests take a long time, so they aren't run on GHA, but post-merge on Buildbot. You can see them here: https://buildbot.python.org/#/release_status

Or locally, using:

./python -m test test_typing -R:

(see ./python -m test --help for more on -R)

@encukou
encukou merged commit 6a139d6 into python:main Jul 31, 2026
56 checks passed
@encukou
encukou deleted the revert-22a6c51 branch July 31, 2026 14:00
@JelleZijlstra

Copy link
Copy Markdown
Member

Example failing build https://buildbot.python.org/#/builders/1610/builds/3766

test_typing leaked [9021, 9017, 9021] references, sum=27059
test_typing leaked [6278, 6276, 6278] memory blocks, sum=18832
Re-running test_typing in verbose mode
test_typing leaked [9021, 9017, 9021] references, sum=27059
test_typing leaked [6278, 6276, 6278] memory blocks, sum=18832

I'm guessing the issue is we reload typing.py and register the callback repeatedly? Though I'm surprised that would leak that much memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants