Skip to content

Migrating task model and backend to use typed_sql.#9410

Open
isoos wants to merge 7 commits into
dart-lang:masterfrom
isoos:task-sql
Open

Migrating task model and backend to use typed_sql.#9410
isoos wants to merge 7 commits into
dart-lang:masterfrom
isoos:task-sql

Conversation

@isoos
Copy link
Copy Markdown
Collaborator

@isoos isoos commented May 25, 2026

@isoos isoos changed the title Reapply "Migrating task model and backend to use typed_sql. (#9126)" (#9393) Migrating task model and backend to use typed_sql. May 27, 2026
@isoos isoos marked this pull request as ready for review May 27, 2026 13:52
@isoos isoos requested review from jonasfj and sigurdm May 27, 2026 13:52
@isoos
Copy link
Copy Markdown
Collaborator Author

isoos commented May 27, 2026

Note: this is re-applying the original rewrite + layering several commits on top of it that address the re-entrant transactions, the query + transaction on the same connection pattern and simplify further parts, e.g. how the dependency timestamp gets updated and read periodically.

Comment thread app/lib/task/backend.dart
scheduleMicrotask(() async {
await pool.withResource(() async {
for (final p in packageNames) {
unawaited(
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.

I guess you disconnect the stacktraces here. Not sure if it is important.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The previous version did disconnect them. The new code preserves the full stacktrace, puts them into a concurrent pool, and then awaits them. I just don't await the individual future that the pool returns. Previously we have used:

  final f = pool.schedue...
  futures.add(f);
  
  await Futures.wait(futures);

But I think it is no longer necessary with this block + awaiting the pool.close();

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