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(core): make forked-process-task-runner robust to closed processes #14289

Merged

Conversation

scottbessler
Copy link
Contributor

@scottbessler scottbessler commented Jan 11, 2023

Ensure that processes that have ended are no longer in the set of processes. Further, ensure the processes are connected before sending them messages.

Current Behavior

forked-process-task-runner never removes processes from this.processes. As such, if you send the task-runner process messages after one of the processes has exited, it throws errors like these:

Error: Channel closed
    at new NodeError (node:internal/errors:393:5)
    at ChildProcess.target.send (node:internal/child_process:740:16)
    at nx/src/tasks-runner/forked-process-task-runner.ts:414:5
    at Set.forEach (<anonymous>)
    at process.<anonymous> (nx/src/tasks-runner/forked-process-task-runner.ts:412:8)
    at process.emit (node:events:525:35)

Expected Behavior

forked-process-task-runner should be resilient to this

Related Issue(s)

Fixes #

@vercel
Copy link

vercel bot commented Jan 11, 2023

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

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Jan 11, 2023 at 10:45PM (UTC)

@nx-cloud
Copy link

nx-cloud bot commented Jan 11, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8e6cb50. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


⌛ The following targets are in progress

✅ Successfully ran 8 targets

Sent with 💌 from NxCloud.

Ensure that processes that have ended are no longer in the
set of processes. Fruther, ensure the processes are connected before
sending them messages.
@AgentEnder AgentEnder merged commit 8518f69 into nrwl:master Jan 12, 2023
@scottbessler scottbessler deleted the forked-process-clean-up-after-itself branch January 12, 2023 16:16
@scottbessler
Copy link
Contributor Author

thanks!

@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 12, 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.

2 participants