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

npm start leaves webpack processes lying around #347

Open
AtkinsSJ opened this issue Apr 25, 2024 · 3 comments
Open

npm start leaves webpack processes lying around #347

AtkinsSJ opened this issue Apr 25, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@AtkinsSJ
Copy link
Collaborator

Noticed this initially when I started getting a whole bunch of errors like this when running npm start:

[INFO::__dev-watcher] (3.967s) [puter.js:webpack-watch:err] Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/sam/Projects/HeyPuter/puter/packages/puter-js'

I'd been repeatedly starting puter, then stopping it with Ctrl-C, to test some changes I was making.

Sure enough, looking at the process monitor, I had a lot of webpack processes still around from previous npm starts. It seems that however they are spawned, they don't die with the parent process.

@AtkinsSJ AtkinsSJ added the bug Something isn't working label Apr 25, 2024
@AtkinsSJ
Copy link
Collaborator Author

AtkinsSJ commented Apr 25, 2024

The EMFILE error might have been caused by some of my local changes, but the webpack issue isn't.

@KernelDeimos
Copy link
Contributor

I was worried this might happen. I actually have no idea how to make sure child processes actually exit in node - maybe it can't be done? Maybe we need to record PIDs and invoke the kill command on the exit handler? I'm adding the "help wanted" label to this.

@KernelDeimos KernelDeimos added the help wanted Extra attention is needed label Apr 26, 2024
@Eric-Lighthall
Copy link
Contributor

It looks like this might be specific to UNIX with using spawn and shell:true.

Adding detached: true in spawn and using process.kill(-proc.pid) seems to work, but I'm not entirely sure if this alters some behavior that we don't want.

Here's something related I found. Issue #46865 in Node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants