Repository navigation
gh-159645: Fix --async-aware profiles showing event loop frames under tasks - #159679
deadlovelll wants to merge 2 commits into
Conversation
pablogsal
left a comment
There was a problem hiding this comment.
hummm I don’t think this is a correct fix. FRAME_EXECUTING does not guarantee that the task frame is in the thread stack.
For example, when spin() yields at await asyncio.sleep(0), _YIELD_VALUE removes its frame before it updates gi_frame_state. A sample between those writes sees FRAME_EXECUTING, but the thread stack already leads back to the event loop:
Handle._run -> BaseEventLoop._run_once -> BaseEventLoop.run_forever
parse_async_frame_chain() never reaches the spin() frame, yet it returns success. Those event-loop frames then replace the task’s logical coroutine chain. This also affects --blocking, since the process can stop between those writes.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Thanks! I'll think about proper solution |
Fix --async-aware profiles showing event loop frames under tasks
See gh-159645