Skip to content

Commit

Permalink
Merge pull request #4744 from spalger/fix/restartCleanly
Browse files Browse the repository at this point in the history
Immediately kill workers to prevent straglers
  • Loading branch information
jbudz committed Aug 25, 2015
2 parents 2d58242 + 3e88539 commit f71275c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cli/cluster/ClusterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ module.exports = class ClusterManager {
rl.prompt();

rl.on('line', line => {
nls = line.trim() ? 0 : nls + 1;
nls = nls + 1;

if (nls >= 2) {
clearSoon.cancel();
clear();
Expand Down
4 changes: 3 additions & 1 deletion src/cli/cluster/Worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ let dead = fork => {
};

let kill = fork => {
fork.kill('SIGINT'); // make it snappy
// fork.kill() waits for process to disconnect, but causes occasional
// "ipc disconnected" errors and is too slow for the proc's "exit" event
fork.process.kill();
fork.killed = true;
};

Expand Down

0 comments on commit f71275c

Please sign in to comment.