Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(turborepo): Persistent Tasks in Watch Mode #7922

Merged
merged 10 commits into from
Apr 23, 2024

Conversation

NicholasLYang
Copy link
Contributor

@NicholasLYang NicholasLYang commented Apr 9, 2024

Description

Implements handling of persistent tasks. Basically, we strip out any persistent tasks from the task graph when we do either an execution for package rediscovery or package changes. Instead, we run the persistent tasks in a separate thread, so they don't block anything.

Testing Instructions

Added tests for both pruning methods.

Closes TURBO-2775

Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2024 4:10pm
examples-svelte-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 22, 2024 4:10pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2024 4:10pm
turbo-turbo-tracing-next-plugin ❌ Failed (Inspect) Apr 22, 2024 4:10pm
7 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:10pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:10pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:10pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:10pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:10pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:10pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 4:10pm

Copy link
Contributor Author

NicholasLYang commented Apr 9, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @NicholasLYang and the rest of your teammates on Graphite Graphite

Copy link
Contributor

github-actions bot commented Apr 9, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented Apr 9, 2024

🟢 CI successful 🟢

Thanks

@NicholasLYang NicholasLYang force-pushed the nicholasyang/watch-walker branch from e35643c to 8841992 Compare April 12, 2024 16:22
@NicholasLYang NicholasLYang force-pushed the nicholasyang/persistent-tasks branch from d85286a to 87e13f4 Compare April 12, 2024 16:22
@NicholasLYang NicholasLYang force-pushed the nicholasyang/watch-walker branch from 8841992 to 0adec70 Compare April 15, 2024 16:03
@NicholasLYang NicholasLYang force-pushed the nicholasyang/persistent-tasks branch from 87e13f4 to 0d4f68d Compare April 15, 2024 16:03
@NicholasLYang NicholasLYang force-pushed the nicholasyang/watch-walker branch from 0adec70 to d8609f2 Compare April 16, 2024 14:54
@NicholasLYang NicholasLYang force-pushed the nicholasyang/persistent-tasks branch from 0d4f68d to 02a5e85 Compare April 16, 2024 14:54
@NicholasLYang NicholasLYang force-pushed the nicholasyang/watch-walker branch from 14a2f79 to df46f8a Compare April 17, 2024 19:22
@NicholasLYang NicholasLYang force-pushed the nicholasyang/persistent-tasks branch from 02a5e85 to 24a0c13 Compare April 17, 2024 19:22
if run.has_persistent_tasks() {
// Abort old run
if let Some(run) = persistent_tasks_handle.take() {
run.abort();
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this run synchronously? Do we need to await the handle after calling abort?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the actual cancelation will likely happen at the next await point. We don't need to await the handle.

Copy link
Contributor

@gsoltis gsoltis left a comment

Choose a reason for hiding this comment

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

LGTM, just the one question about aborting an in-progress run.

@NicholasLYang NicholasLYang merged commit da53c14 into main Apr 23, 2024
56 checks passed
@NicholasLYang NicholasLYang deleted the nicholasyang/persistent-tasks branch April 23, 2024 21:24
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