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(node): wait for subprocess to exit when --watch=false in execute executor #9087

Closed
wants to merge 2 commits into from
Closed

fix(node): wait for subprocess to exit when --watch=false in execute executor #9087

wants to merge 2 commits into from

Conversation

jlndk
Copy link

@jlndk jlndk commented Feb 22, 2022

Fixes #7031

Current Behavior

Before this fix, the node/execute executor would exit immediately and let the node subprocess continue in the background, if watch was set to false.

Expected Behavior

This PR attempts to fix this problem, by implementing the patch suggested in #7031 (comment), adding event listeners on the subprocess if watch is false, such that the nx process simply waits until the subprocess exists (successfully or not).

Error handling has also been added such that the executor fails if a non-successful status code is returned by the program

…cute executor

Fixes #7031.

Before this fix, the executor would exit immediately and let the node subprocess continue in the background,
if watch was set to false.
This commit attempts to fix this problem, by adding event listeners on the subprocess in the node/execute
executor if watch is false, such that the nx process continues simply (a)waits until the subprocess exists
(successfully or not).

Error handling has also been added such that the executor fails if a non-successful status code is returned by the program
@vercel
Copy link

vercel bot commented Feb 22, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/uwgHgyaDVP7dJKNu6Vewc8MsTFFf
✅ Preview: https://nx-dev-git-fork-jlndk-issue-7031-fix-node-executor-6bbb19-nrwl.vercel.app

@jlndk jlndk changed the title fix(node): wait for subprocess to exit when --watch=false in execute executor fix(node): wait for subprocess to exit when --watch=false in execute executor Feb 23, 2022
@hcharley
Copy link

I think this may answer my question here: #5726

@hcharley
Copy link

Is there anything preventing this from being merged and included in the next release?

@FrozenPandaz
Copy link
Collaborator

This was fixed with #9180.

Thank you @jlndk

@jlndk jlndk deleted the issue-7031/fix-node-executor-immediate-exit-when-watch-false branch May 6, 2022 21:32
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The node:execute builder immediately exits after build when --watch=false.
5 participants