trivago / parallel-webpack

Builds multi-config webpack projects in parallel
BSD 3-Clause "New" or "Revised" License
1.48k stars 96 forks source link

parallel-webpack often leaves zombie processes #57

Open davydog187 opened 7 years ago

davydog187 commented 7 years ago

Will try to find a way to reproduce, but often running parallel-webpack leaves behind 8 or so node processes that eat up a ton of CPU/memory.

anilanar commented 7 years ago

I confirm.

sprinklr-gurgaon commented 7 years ago

Yes. We have to manually kill those process. Best way: sudo killall -9 node

davydog187 commented 7 years ago

Thanks, I understand that you can kill the processes, but that’s not the problem. The issue is the fact that they are there, frequently, and consuming a ton of cpu and memory. You’re describing how to address the symptom not the cause

siebertm commented 7 years ago

I also just stumbled over this problem when watching.

My initial thought was that there is no SIGINT handler defined (Ctrl-C), but there is.

Then I checked a bit more, and found this:

[WEBPACK] Started watching [name].js
^C[WEBPACK] Forcefully shutting down

events.js:182                                                                                                                                                                                               
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at _errnoException (util.js:1021:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:860:14)
[WEBPACK] Build failed after 4.419 seconds
[WEBPACK] Forcefully shut down [name].js

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at _errnoException (util.js:1021:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:860:14)

My environment: nodejs v8.7.0, webpack v3.6.0. parallel-webpack is started through my package.json using yarn run

When I tried to run parallel-webpack directly without yarn, I got a slightly different error message:

[WEBPACK 08:59:01] Finished building [name].js within 8.555 seconds
^C[WEBPACK] Forcefully shutting down
Worker Farm: Received message for unknown child. This is likely as a result of premature child death, the operation will have been re-queued.
[WEBPACK] Build failed after 11.127 seconds
[WEBPACK] Forcefully shut down modules/desktop/index.js
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
    at process.target.send (internal/child_process.js:590:16)
    at callback (/home/siebert/code/platform/node_modules/worker-farm/lib/child/index.js:32:17)
    at process.shutdownCallback (/home/siebert/code/platform/node_modules/parallel-webpack/src/webpackWorker.js:93:17)
    at emitNone (events.js:105:13)
    at process.emit (events.js:207:7)
    at Signal.wrap.onsignal (internal/process.js:205:44)
iorrah commented 4 years ago

This issue has been opened for almost 3 years now and there's also #29, #33 and #38. Is this bug likely to get solved? Could it actually be the result of misconfiguration? There's no note about the repo getting archived in the README. I'd like to use this as dependency but I don't know if it's safe for production.