Repository navigation
gh-158688: Fix crash when dumping a deep chain of awaiting tasks - #158960
deadlovelll wants to merge 5 commits into
Conversation
|
@maurycy happy to see your review here =) |
|
@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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
yes. just pushed the change!
There was a problem hiding this comment.
@deadlovelll Does the crash still happen after merging #153365? My understanding is that we only get RuntimeError, and the visited set was added in #161508. And, if I'm reading the PR right, it effectively removes the 16384 limit for get_async_stack_trace() and keeps it only for futures from get_all_awaited_by().
yeah, segfault disappeared. but i thought about limits.. if we already handles cycles and repeated visitis, do we still need a hard limit? Maybe i'm missig something |
I'd say so. Other walks are bounded ( |
|
Since #153365 fixed the crash, can you update the title, description, and NEWS entry to describe the proposed limit change? What workload needs more than 16,384 tasks? The visited set skips repeated tasks. We still need a hard limit on how many distinct tasks one call can visit. |
thank you for explanation, that makes sense. regarding the limit increase I think this needs to be tested in practice, I haven’t done that yet. In any case, this topic probably warrants a separate issue. as for this pr, it seems to have run its course, since it addressed things that have already been fixed. If you agree, I’ll close it. |
|
Yes, please close this one. Thanks for the PR! |
Fix crash when dumping a deep chain of awaiting tasks
For details see gh-158688