Skip to content

[ui] switch to asynch queue for trace loading#164

Merged
colin-grant-work merged 2 commits into
sokatoafrom
bugfix/actually-load-all-traces
Nov 25, 2025
Merged

[ui] switch to asynch queue for trace loading#164
colin-grant-work merged 2 commits into
sokatoafrom
bugfix/actually-load-all-traces

Conversation

@colin-grant-work

@colin-grant-work colin-grant-work commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator

The AsynchLimiter just ignores tasks if it sees a queue. We want all the traces we ask for to actually load (probably - would be nice to have cancelation, but we don't), so this adds an asynch queueing implementation and uses that for trace loading instead of the limiter.

To test:

  1. Follow the directions in https://github.com/android-graphics/sokatoa/issues/4155
  2. You should find it even harder than before to reproduce the case where something would get stuck loading.

Welcome to Perfetto!
Make sure your PR has a bug/issue attached or has at least
a clear description of the problem you are trying to fix.

For more details please see
https://perfetto.dev/docs/contributing/getting-started

@colin-grant-work

Copy link
Copy Markdown
Collaborator Author

@cdamus, I was surprised to see that there wasn't an equivalent of an asynch queue already available in the utilities. Did I miss something?

@colin-grant-work colin-grant-work changed the title [ui] switch to asynch queue [ui] switch to asynch queue for trace loading Nov 24, 2025

@cdamus cdamus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just a couple of quibbles in-line and this is the sort of thing for which we do generally add unit tests in Perfetto: generic utilities. Perhaps just ask an AI to scratch something up; it will do an amazing job of it.

Comment thread ui/src/base/async_queue.ts Outdated
*
* @param work An async function to schedule.
* @returns A promise that resolves when either the task has finished
* executing, or after the task has silently been discarded because a newer

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the whole point is not to discard any task?

Comment thread ui/src/base/async_queue.ts Outdated
@@ -0,0 +1,68 @@
// Copyright (C) 2024 The Android Open Source Project

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025?

@cdamus cdamus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Love the tests 😀

@colin-grant-work
colin-grant-work merged commit bf79eb3 into sokatoa Nov 25, 2025
1 check passed
@colin-grant-work
colin-grant-work deleted the bugfix/actually-load-all-traces branch November 25, 2025 21:36
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.

2 participants