Skip to content

gh-158688: Fix crash when dumping a deep chain of awaiting tasks - #158960

Open
deadlovelll wants to merge 3 commits into
python:mainfrom
deadlovelll:gh-158688-recursion-v2
Open

deadlovelll wants to merge 3 commits into
python:mainfrom
deadlovelll:gh-158688-recursion-v2

Conversation

@deadlovelll

Copy link
Copy Markdown
Contributor

Fix crash when dumping a deep chain of awaiting tasks

For details see gh-158688

@deadlovelll

Copy link
Copy Markdown
Contributor Author

@maurycy happy to see your review here =)

@maurycy

maurycy commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@deadlovelll Thank you! I will try to do so over the weekend.

self.assertEqual(asyncio.run(rec(3)), ["rec"] * 4)

@skip_if_not_supported
def test_deep_awaiter_chain_is_walked_fully(self):

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.

Can we add a graph where two waiters share the same parent? Both changed tests still pass without the seen set. The extra b task does not make the walk visit a task twice.

My shared-parent check returns root, p, q, shared, shared without seen. It returns four unique tasks with this patch. A cycle case can also check that the walk terminates.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants