Skip to content

gh-155515: Use GC track for HAMT iterators - #155517

Merged
kumaraditya303 merged 1 commit into
python:mainfrom
nascheme:gh-155515-hamt-iter-gc-track
Aug 13, 2026
Merged

gh-155515: Use GC track for HAMT iterators#155517
kumaraditya303 merged 1 commit into
python:mainfrom
nascheme:gh-155515-hamt-iter-gc-track

Conversation

@nascheme

@nascheme nascheme commented Aug 10, 2026

Copy link
Copy Markdown
Member

Track the internal HAMT iterators, which back iteration over a contextvars.Context. A reference cycle running through such an iterator was never collected, leaking the whole context it iterated over.

Track the internal HAMT iterators, which back iteration over a
contextvars.Context.  A reference cycle running through such an iterator
was never collected, leaking the whole context it iterated over.
@nascheme
nascheme marked this pull request as ready for review August 12, 2026 15:19
@nascheme
nascheme requested a review from 1st1 as a code owner August 12, 2026 15:20
@kumaraditya303 kumaraditya303 added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 13, 2026
@kumaraditya303
kumaraditya303 merged commit f056212 into python:main Aug 13, 2026
66 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @nascheme for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Aug 13, 2026

Copy link
Copy Markdown

GH-155697 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 13, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry, @nascheme and @kumaraditya303, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f0562124927ec0087a5d3460efe08567aab64b84 3.13

@bedevere-app

bedevere-app Bot commented Aug 13, 2026

Copy link
Copy Markdown

GH-155698 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 13, 2026
mbeijen pushed a commit to mbeijen/cpython that referenced this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.13 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants