Skip to content

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

Closed
deadlovelll wants to merge 1 commit into
python:mainfrom
deadlovelll:gh-158688-recursion
Closed

deadlovelll wants to merge 1 commit into
python:mainfrom
deadlovelll:gh-158688-recursion

Conversation

@deadlovelll

Copy link
Copy Markdown
Contributor

Fix crash when dumping a deep chain of awaiting tasks

For more details see gh-158688

@maurycy

maurycy commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

I think this is a duplicate of #153365

@deadlovelll

Copy link
Copy Markdown
Contributor Author

I think this is a duplicate of #153365

hi! yes, i see problems overlaps. But solutions differ

#153365 keeps no visited set, so the check if there are infinite loop or not only depends on the const (MAX_TASK_WAITER_WALK_TASKS). For example repro from #158688 with range(20000) instead of 5000 will raise an RuntimeError

RuntimeError: Too many task waiters (possible infinite loop)

But actually the program does not produce the infinite loop

I don't think these PRs compete, #153365 covers things mine doesn't. Feel free to cherry pick this commit into your PR =)

@maurycy

maurycy commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@deadlovelll I fully agree that the visited set is a valuable addition. Do you want to tackle this, now once #153365 landed?

ref #153365 (comment)

@deadlovelll

Copy link
Copy Markdown
Contributor Author

@deadlovelll I fully agree that the visited set is a valuable addition. Do you want to tackle this, now once #153365 landed?

ref #153365 (comment)

yeah sure

@deadlovelll

Copy link
Copy Markdown
Contributor Author

@deadlovelll I fully agree that the visited set is a valuable addition. Do you want to tackle this, now once #153365 landed?
ref #153365 (comment)

yeah sure

I'm gonna close this and open the new one, it's gonna be simpler rather than trying to merge

@deadlovelll deadlovelll closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants