Skip to content

gh-163217: Fix await cycle reporting in async-aware stack dumps - #163219

Open
deadlovelll wants to merge 1 commit into
python:mainfrom
deadlovelll:gh-163217-cycle
Open

deadlovelll wants to merge 1 commit into
python:mainfrom
deadlovelll:gh-163217-cycle

Conversation

@deadlovelll

Copy link
Copy Markdown
Contributor

Fix await cycle reporting in async-aware stack dumps

See gh-163217

Comment thread Lib/asyncio/tools.py
for awaited_info in result
for task in awaited_info.awaited_by
}
raise CycleFoundException(cycles, id2name)

@maurycy maurycy Dec 6, 2026 •

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.

An await cycle can be a valid state for the target. The example from the issue is valid (asyncio.wait() with timeout so it resolves on its own). I'm not sure if dump should refuse to print (it's similar to asyncio ps).

Could iter_async_frames() start from the leaves as it does now, then pick one task from each cycle it missed? There's already visited in _build_linear_stacks(). That'd cover dump and the collectors.

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.

2 participants