Skip to content

gh-93297: Make asyncio task groups prevent child tasks from being GCed - #93299

Merged
1st1 merged 1 commit into
python:mainfrom
1st1:fixtg
May 27, 2022
Merged

1st1 merged 1 commit into
python:mainfrom
1st1:fixtg

Conversation

@1st1

@1st1 1st1 commented May 27, 2022

Copy link
Copy Markdown
Member

No description provided.

@1st1 1st1 added the needs backport to 3.11 only security fixes label May 27, 2022
@1st1
1st1 requested review from ambv and gvanrossum May 27, 2022 20:20
@1st1
1st1 requested a review from asvetlov as a code owner May 27, 2022 20:20

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, but it looks like self._unfinished_tasks is now redundant -- it is always equal to len(self._tasks), isn't it?

@1st1

1st1 commented May 27, 2022

Copy link
Copy Markdown
Member Author

Okay, but it looks like self._unfinished_tasks is now redundant -- it is always equal to len(self._tasks), isn't it?

Yeah, true. The code looks cleaner now, please see the updated diff.

@fantix fantix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread Lib/asyncio/taskgroups.py Outdated

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@1st1
1st1 merged commit e6a5767 into python:main May 27, 2022
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @1st1 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 27, 2022
…ng GCed (pythonGH-93299)

(cherry picked from commit e6a5767)

Co-authored-by: Yury Selivanov <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label May 27, 2022
@bedevere-bot

Copy link
Copy Markdown

GH-93305 is a backport of this pull request to the 3.11 branch.

@1st1
1st1 deleted the fixtg branch May 27, 2022 22:20
1st1 pushed a commit that referenced this pull request May 27, 2022
GH-93299) (#93305)

(cherry picked from commit e6a5767)

Co-authored-by: Yury Selivanov <[email protected]>

Co-authored-by: Yury Selivanov <[email protected]>
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.

5 participants