summaryrefslogtreecommitdiff
path: root/src/mongo/shell/servers.js
diff options
context:
space:
mode:
authorMikhail Shchatko <mikhail.shchatko@mongodb.com>2020-09-09 20:05:42 +0300
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-27 23:23:02 +0000
commit3681b03baaa6dd30e9ebc237365b81d755412e7b (patch)
treeeadd61332f40ccad016ceca68cc4bc861b162806 /src/mongo/shell/servers.js
parentb893fe9695ab69ef28782bda1deff9cb2c070d9a (diff)
downloadmongo-3681b03baaa6dd30e9ebc237365b81d755412e7b.tar.gz
SERVER-50748 Add repl and sharding tasks to the undodb variant
Diffstat (limited to 'src/mongo/shell/servers.js')
-rw-r--r--src/mongo/shell/servers.js31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index 2dcff0c0869..c23b9afff65 100644
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -1057,19 +1057,9 @@ var stopMongoProgram = function(conn, signal, opts, waitpid) {
returnCode = _stopMongoProgram(port, signal, opts, waitpid);
}
- if (conn.undoLiveRecordPid) {
- print("Saving the UndoDB recording; it may take a few minutes...");
- returnCode = waitProgram(conn.undoLiveRecordPid);
- if (returnCode !== 0) {
- throw new Error(
- "Undo live-record failed to terminate correctly. This is likely a bug in Undo. " +
- "Please record any logs and send them to the #server-tig Slack channel");
- }
- }
-
// If we are not waiting for shutdown, then there is no exit code to check.
if (!waitpid) {
- return 0;
+ returnCode = 0;
}
if (allowedExitCode !== returnCode) {
throw new MongoRunner.StopError(returnCode);
@@ -1078,6 +1068,10 @@ var stopMongoProgram = function(conn, signal, opts, waitpid) {
returnCode);
}
+ if (conn.undoLiveRecordPid) {
+ _stopUndoLiveRecord(conn.undoLiveRecordPid);
+ }
+
return returnCode;
};
@@ -1398,6 +1392,9 @@ MongoRunner.awaitConnection = function({pid, port, undoLiveRecordPid = null} = {
print("mongo program was not running at " + port +
", process ended with exit code: " + res.exitCode);
serverExitCodeMap[port] = res.exitCode;
+ if (undoLiveRecordPid) {
+ _stopUndoLiveRecord(undoLiveRecordPid);
+ }
return true;
}
}
@@ -1407,10 +1404,20 @@ MongoRunner.awaitConnection = function({pid, port, undoLiveRecordPid = null} = {
};
var _runUndoLiveRecord = function(pid) {
- var argArray = [jsTestOptions().undoRecorderPath, "--thread-fuzzing", "-p", pid];
+ var argArray = [jsTestOptions().undoRecorderPath, "-p", pid];
return _startMongoProgram.apply(null, argArray);
};
+var _stopUndoLiveRecord = function(undoLiveRecordPid) {
+ print("Saving the UndoDB recording; it may take a few minutes...");
+ var undoReturnCode = waitProgram(undoLiveRecordPid);
+ if (undoReturnCode !== 0) {
+ throw new Error(
+ "Undo live-record failed to terminate correctly. This is likely a bug in Undo. " +
+ "Please record any logs and send them to the #server-tig Slack channel");
+ }
+};
+
/**
* Start a mongo process with a particular argument array.
* If we aren't waiting for connect, return {pid: <pid>}.