Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Comments
gh-86802: Fix asyncio memory leak; shielded tasks where cancelled log…#134331
gh-86802: Fix asyncio memory leak; shielded tasks where cancelled log…#134331ambv merged 4 commits intopython:mainfrom
Conversation
…ed log once through the exception handler
python-cla-botbot commentedMay 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Uh oh!
There was an error while loading.Please reload this page.
| def _outer_done_callback(outer): | ||
| if not inner.done(): | ||
| inner.remove_done_callback(_inner_done_callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Before this PR, this line made thefuture_discard_from_awaited_by never execute for cases when the outer shield was cancelled. That was a memory leak, which is now fixed.
| if cur_task is not None: | ||
| inner.add_done_callback(_clear_awaited_by_callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Now we're only adding the callback tofuture_discard_from_awaited_by when thereis a current task. Nice.
f695eca intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@ChristianHrs for the PR, and@ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
… once through the exception handler (pythongh-134331)(cherry picked from commitf695eca)Co-authored-by: Christian Harries <68507104+ChristianHrs@users.noreply.github.com>Co-authored-by: Łukasz Langa <lukasz@langa.pl>
GH-134343 is a backport of this pull request to the3.14 branch. |
pablogsal commentedMay 20, 2025
@ambv you are indeed a provider |
…ions log once through the exception handler (pythongh-134331)"This reverts commitf695eca.
…ions log once through the exception handler (pythongh-134331)"This reverts commitf695eca.
… once through the exception handler (pythongh-134331)Co-authored-by: Łukasz Langa <lukasz@langa.pl>
… once through the exception handler (pythongh-134331)Co-authored-by: Łukasz Langa <lukasz@langa.pl>
… once through the exception handler (pythongh-134331)Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Uh oh!
There was an error while loading.Please reload this page.
… once through the exception handler