diff options
author | Mikhail Shchatko <mikhail.shchatko@mongodb.com> | 2020-09-09 20:05:42 +0300 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-27 23:23:02 +0000 |
commit | 3681b03baaa6dd30e9ebc237365b81d755412e7b (patch) | |
tree | eadd61332f40ccad016ceca68cc4bc861b162806 /src/mongo | |
parent | b893fe9695ab69ef28782bda1deff9cb2c070d9a (diff) | |
download | mongo-3681b03baaa6dd30e9ebc237365b81d755412e7b.tar.gz |
SERVER-50748 Add repl and sharding tasks to the undodb variant
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/shell/servers.js | 31 |
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>}. |