Skip to content

fix: asyncio task reports and running task - #57

Merged
P403n1x87 merged 1 commit into
mainfrom
chore/task-running
Oct 21, 2026
Merged

P403n1x87 merged 1 commit into
mainfrom
chore/task-running

Conversation

@P403n1x87

Copy link
Copy Markdown
Owner

We fix how asyncio task data is read and written, and add support for the running task of a sample.

Task time used to be attached to every sample's task tree, so the same report was counted again at every sample that followed. Task trees now only hold structure, and each task report is attached once to the sample it came with, together with the task's previous position.

Task reports no longer carry time on the wire: they are delimited by their frame count, and the reader works out the time a task spends at a position from its thread's samples while it holds it without running (none in CPU mode). At the end of a stream, every live task gets a report with the time it has spent at its position since its last one.

Tasks that are gone are now forgotten together with their waiter edges, a task's waiter set no longer merges with an earlier one across samples, a waiter of 0 empties it, and a waiter that isn't known no longer hides the tasks it awaits.

MOJO_TASK_RUNNING gives the task a sample's thread was running at that sample, as AustinSample.running_task. The writer writes task reports as they were read and only the waiter edges that changed, and compressed task ids start at 1, 0 standing for no task.

Requirements for Adding, Changing, Fixing or Removing a Feature

Fill out the template below. Any pull request that does not include enough
information to be reviewed in a timely manner may be closed at the maintainers'
discretion.

We fix how asyncio task data is read and written, and add support for the
running task of a sample.

Task time used to be attached to every sample's task tree, so the same
report was counted again at every sample that followed. Task trees now only
hold structure, and each task report is attached once to the sample it came
with, together with the task's previous position.

Task reports no longer carry time on the wire: they are delimited by their
frame count, and the reader works out the time a task spends at a position
from its thread's samples while it holds it without running (none in CPU
mode). At the end of a stream, every live task gets a report with the time
it has spent at its position since its last one.

Tasks that are gone are now forgotten together with their waiter edges, a
task's waiter set no longer merges with an earlier one across samples, a
waiter of 0 empties it, and a waiter that isn't known no longer hides the
tasks it awaits.

MOJO_TASK_RUNNING gives the task a sample's thread was running at that
sample, as AustinSample.running_task. The writer writes task reports as they
were read and only the waiter edges that changed, and compressed task ids
start at 1, 0 standing for no task.
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.39252% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.14%. Comparing base (059e78c) to head (7cf2f43).

Files with missing lines Patch % Lines
austin/format/mojo.py 93.68% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
+ Coverage   78.61%   79.14%   +0.53%     
==========================================
  Files          20       20              
  Lines        1987     2057      +70     
  Branches      246      256      +10     
==========================================
+ Hits         1562     1628      +66     
- Misses        353      355       +2     
- Partials       72       74       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@P403n1x87
P403n1x87 marked this pull request as ready for review October 21, 2026 09:28
@P403n1x87
P403n1x87 merged commit a54a7cf into main Oct 21, 2026
19 checks passed
@P403n1x87
P403n1x87 deleted the chore/task-running branch October 21, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant