Skip to content

Commit a56c37d

Browse files
author
Ben Newman
committed
Make sure process.kill is always called with a numeric PID.
This appears to be one of the biggest changes between Node v0.10 and v4.4 for the Meteor codebase. Relevant commit: nodejs/node@832ec1c Part of meteor#6921.
1 parent 3fe3e05 commit a56c37d

5 files changed

Lines changed: 22 additions & 7 deletions

File tree

tools/inspector.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ DEp.stop = function stop() {
227227
var proc = this.inspectorProcess;
228228
if (proc && proc.kill) {
229229
this.inspectorProcess = null;
230-
proc.kill();
230+
// The .kill method now requires a numeric argument:
231+
// https://github.com/nodejs/node/commit/832ec1cd50
232+
proc.kill(proc.pid);
231233
}
232234

233235
if (this.interceptServer) {

tools/runners/run-app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ _.extend(AppProcess.prototype, {
166166
if (self.proc && self.proc.pid) {
167167
self.proc.removeAllListeners('close');
168168
self.proc.removeAllListeners('error');
169-
self.proc.kill();
169+
// The .kill method now requires a numeric argument:
170+
// https://github.com/nodejs/node/commit/832ec1cd50
171+
self.proc.kill(self.proc.pid);
170172
}
171173
self.proc = null;
172174

tools/runners/run-mongo.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,9 @@ var launchMongo = function (options) {
475475
stop: function () {
476476
if (proc) {
477477
proc.removeListener('exit', procExitHandler);
478-
proc.kill('SIGINT');
478+
// The .kill method now requires a numeric first argument:
479+
// https://github.com/nodejs/node/commit/832ec1cd50
480+
proc.kill(proc.pid, 'SIGINT');
479481
proc = null;
480482
}
481483
}

tools/runners/run-velocity.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ var runVelocity = function (url) {
3030

3131
var killBrowserProcesses = function () {
3232
browserProcesses.forEach(function (browserProcess) {
33-
browserProcess.kill('SIGINT');
33+
// The .kill method now requires a numeric first argument:
34+
// https://github.com/nodejs/node/commit/832ec1cd50
35+
browserProcess.kill(browserProcess.pid, 'SIGINT');
3436
});
3537
browserProcesses = [];
3638
};

tools/tool-testing/selftest.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,9 @@ _.extend(PhantomClient.prototype, {
966966
var self = this;
967967
// Suppress the expected SIGTERM exit 'failure'
968968
self._logError = false;
969-
self.process && self.process.kill();
969+
// The .kill method now requires a numeric first argument:
970+
// https://github.com/nodejs/node/commit/832ec1cd50
971+
self.process && self.process.kill(self.process.pid);
970972
self.process = null;
971973
}
972974
});
@@ -1031,7 +1033,10 @@ _.extend(BrowserStackClient.prototype, {
10311033

10321034
stop: function() {
10331035
var self = this;
1034-
self.tunnelProcess && self.tunnelProcess.kill();
1036+
// The .kill method now requires a numeric first argument:
1037+
// https://github.com/nodejs/node/commit/832ec1cd50
1038+
self.tunnelProcess &&
1039+
self.tunnelProcess.kill(self.tunnelProcess.pid);
10351040
self.tunnelProcess = null;
10361041

10371042
self.driver && self.driver.quit();
@@ -1406,7 +1411,9 @@ _.extend(Run.prototype, {
14061411
// processes.
14071412
utils.execFileSync("taskkill", ["/pid", this.proc.pid, '/f', '/t']);
14081413
} else {
1409-
this.proc.kill();
1414+
// The .kill method now requires a numeric first argument:
1415+
// https://github.com/nodejs/node/commit/832ec1cd50
1416+
this.proc.kill(this.proc.pid);
14101417
}
14111418
},
14121419

0 commit comments

Comments
 (0)