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

fix(Turborepo): Ensure process manager stays closed #6258

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

gsoltis
Copy link
Contributor

@gsoltis gsoltis commented Oct 23, 2023

Description

  • Adds tests for process manager remaining closed after being closed (courtesy of @chris-olszewski )
  • Ensures the process manager does not reopen after close has been called, or after wait has completed.

Testing Instructions

Updated tests.

Closes TURBO-1526

@vercel
Copy link

vercel bot commented Oct 23, 2023

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

Name Status Preview Comments Updated (UTC)
examples-native-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 24, 2023 10:11pm
examples-nonmonorepo 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 24, 2023 10:11pm
9 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm
examples-cra-web ⬜️ Ignored (Inspect) Oct 24, 2023 10:11pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm
turbo-site ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2023 10:11pm

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

🟢 Turbopack Benchmark CI successful 🟢

Thanks

@gsoltis gsoltis marked this pull request as ready for review October 23, 2023 22:29
@gsoltis gsoltis requested a review from a team as a code owner October 23, 2023 22:29
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2023

🟢 CI successful 🟢

Thanks

Copy link
Contributor

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

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

I think it makes sense to move the child cleanup behavior change to it's own PR. The API feels a little weird and at the very least it deserves a more involved PR review. I think having unbounded child vector growth is fine since it will always just be the size of all tasks that we execute.

@@ -22,6 +22,7 @@ use std::{
};

use command_group::AsyncCommandGroup;
use futures::Future;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
use futures::Future;


// just allocate a new vec rather than clearing the old one
lock.children = vec![];
lock.is_closing = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can probably just remove this line to get the prime functionality of the PR. I think the children cleaning up after themselves deserves it's own PR.

if let Ok(child) = &child {
lock.children.push(child.clone());
}
let inner = Arc::clone(&self.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Slightly concerned as we're creating a cycle here with the Arc getting moved into the child.

  • child -> inner via the variables that the closure captures
  • inner.children[index] -> child
    I think we are correct as long as the closure always gets dropped which should always happen, but that is dependent on a tokio task exiting which we don't keep a handle around for.

@gsoltis gsoltis force-pushed the gsoltis/keep_process_manager_closed branch from 709e6cd to a1f077f Compare October 24, 2023 22:10
@gsoltis
Copy link
Contributor Author

gsoltis commented Oct 24, 2023

Dropped the child cleanup piece

@gsoltis gsoltis merged commit 849cfec into main Oct 26, 2023
60 of 61 checks passed
@gsoltis gsoltis deleted the gsoltis/keep_process_manager_closed branch October 26, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants