From c131ce7e7cd2e59cca655d16d23dd7646efa0d0e Mon Sep 17 00:00:00 2001 From: spalger Date: Mon, 24 Aug 2015 18:43:44 -0700 Subject: [PATCH 1/2] [cluster/restart] allow non-empty lines in manual restart --- src/cli/cluster/ClusterManager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/cluster/ClusterManager.js b/src/cli/cluster/ClusterManager.js index d28b1d1c1d86f..5bce6a5832c66 100644 --- a/src/cli/cluster/ClusterManager.js +++ b/src/cli/cluster/ClusterManager.js @@ -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(); From 3e88539056c87faa1c6012b44635eca7de7faada Mon Sep 17 00:00:00 2001 From: spalger Date: Mon, 24 Aug 2015 18:44:20 -0700 Subject: [PATCH 2/2] [worker/kill] use process.exit() for sync closing of processes --- src/cli/cluster/Worker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli/cluster/Worker.js b/src/cli/cluster/Worker.js index d4d752e4e48b8..ab57e350a3285 100644 --- a/src/cli/cluster/Worker.js +++ b/src/cli/cluster/Worker.js @@ -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; };