summaryrefslogtreecommitdiff
path: root/src/mongo/shell/servers.js
diff options
context:
space:
mode:
authorWilliam Schultz <william.schultz@mongodb.com>2019-11-04 23:38:40 +0000
committerevergreen <evergreen@mongodb.com>2019-11-04 23:38:40 +0000
commita417e979908af2124b990d68a22c437005877790 (patch)
tree5017c2eed8104aac2b82e9ac30a8939819c0aaf4 /src/mongo/shell/servers.js
parent56866f4163b6fa7a5f8bf3404b46b47df02c6b3c (diff)
downloadmongo-a417e979908af2124b990d68a22c437005877790.tar.gz
SERVER-39172 Shut down and validate nodes in parallel in ReplSetTest.stopSet
Diffstat (limited to 'src/mongo/shell/servers.js')
-rw-r--r--src/mongo/shell/servers.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index d9f13ffe75d..ff16b2a8b0c 100644
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -918,11 +918,12 @@ MongoRunner.validateCollectionsCallback = function(port) {};
* skipValidation: <bool>,
* allowedExitCode: <int>
* }
+ * @param {boolean} waitpid should we wait for the process to terminate after stopping it.
*
* Note: The auth option is required in a authenticated mongod running in Windows since
* it uses the shutdown command, which requires admin credentials.
*/
-MongoRunner.stopMongod = function(conn, signal, opts) {
+MongoRunner.stopMongod = function(conn, signal, opts, waitpid) {
if (!conn.pid) {
throw new Error("first arg must have a `pid` property; " +
"it is usually the object returned from MongoRunner.runMongod/s");
@@ -935,6 +936,7 @@ MongoRunner.stopMongod = function(conn, signal, opts) {
signal = parseInt(signal) || 15;
opts = opts || {};
+ waitpid = (waitpid === undefined) ? true : waitpid;
var allowedExitCode = MongoRunner.EXIT_CLEAN;
@@ -965,7 +967,12 @@ MongoRunner.stopMongod = function(conn, signal, opts) {
MongoRunner.validateCollectionsCallback(port);
}
- returnCode = _stopMongoProgram(port, signal, opts);
+ returnCode = _stopMongoProgram(port, signal, opts, waitpid);
+ }
+
+ // If we are not waiting for shutdown, then there is no exit code to check.
+ if (!waitpid) {
+ return 0;
}
if (allowedExitCode !== returnCode) {
throw new MongoRunner.StopError(returnCode);