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

🛑 Stop the process when the CLI task is complete #1576

Merged
merged 4 commits into from
Oct 17, 2024
Merged

Conversation

rowanc1
Copy link
Member

@rowanc1 rowanc1 commented Oct 9, 2024

Fixes hanging node process waiting on unresolved promises.

Copy link

changeset-bot bot commented Oct 9, 2024

🦋 Changeset detected

Latest commit: 91dbb5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
myst-cli-utils Patch
myst-cli Patch
mystmd Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rowanc1 rowanc1 requested a review from fwkoch October 9, 2024 21:39
@@ -19,6 +19,9 @@ export function clirun<S extends ISession>(
program: Command;
getSession: (logger: Logger, opts?: SessionOpts) => S;
},
runOptions?: {
forceExit?: boolean | ((...args: any[]) => boolean);
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should flip this to have this be the default and then processes that need to hang (e.g. start/watch) can add work arounds.

@agoose77
Copy link
Contributor

@rowanc1 do we know which processes are hanging? For example, execution is supposed to ensure that everything is cleaned up.

@rowanc1
Copy link
Member Author

rowanc1 commented Oct 10, 2024

I have spent at least four hours trying to track in down to no avail over the last few weeks. Happy for someone else to take a look, but it is a pretty hard thing to find imo....

There were anywhere between 10-100 open promises at the end of the build function. for a Typst build. And it wasn't overly consistent.

I think this hits the user's perceived problem. But for sure there are some things we need to clean up internally.

Fixes hanging node process waiting on unresolved promises.
@rowanc1 rowanc1 merged commit b14e0fb into main Oct 17, 2024
7 checks passed
@rowanc1 rowanc1 deleted the process-exit branch October 17, 2024 15:42
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