remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.35k stars 1.74k forks source link

Nodemon restarts my cluster processes as expected but it keeps logging "still waiting for 6 sub-processes to finish" messages #2226

Closed mateusgrb closed 2 months ago

mateusgrb commented 2 months ago

Expected behaviour

My Nodejs application leverages cluster child processes. I added this block of code as suggested by the docs:

if (cluster.isMaster) {
  process.on("SIGHUP", function () {
    for (const worker of Object.values(cluster.workers)) {
      worker.process.kill("SIGTERM");
    }
  });
} else {
  process.on("SIGHUP", function() {})
}

When I save a js file, my child processes do get restarted and the VS Code debugger is able to reconnect to them so I can keep debugging the application, which is great. However, my terminal keeps getting spammed: [nodemon] still waiting for 6 sub-processes to finish...

Am I missing anything? I mean, processes are restarting with the code changes, which is the main goal, but the logs suggest that I'm missing something. What's nodemon waiting for? Should the subprocesses send anything back to nodemon?

Actual behaviour

[nodemon] still waiting for 6 sub-processes to finish... logs

Steps to reproduce


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

remy commented 2 months ago

Can you give me a pared down version of the code you're using to replicate with?

mateusgrb commented 2 months ago

Sorry, this had nothing to do with nodemon, I figured it out on my end. Closing.