From 52bf0d420aaeb48f5b82a85ae5525d38f6150cd9 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 1 May 2017 11:41:05 -0700 Subject: [PATCH] workers: unref all streams. --- lib/workers/workerpool.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/workers/workerpool.js b/lib/workers/workerpool.js index 092f9c7a..266b94e6 100644 --- a/lib/workers/workerpool.js +++ b/lib/workers/workerpool.js @@ -537,7 +537,11 @@ Worker.prototype._initChildProcess = function _initChildProcess() { var options = { stdio: 'pipe', env: env }; this.child = cp.spawn(file, argv, options); + this.child.unref(); + this.child.stdin.unref(); + this.child.stdout.unref(); + this.child.stderr.unref(); this.child.on('error', function(err) { self.emit('error', err);