summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shell_utils_launcher.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-12-22 14:39:04 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-12-23 13:36:10 -0500
commit944ee09a2aa02f6131748258d67f8a673925c10f (patch)
treea5e1caf7a6f628120322831d571271d34d5b28a6 /src/mongo/shell/shell_utils_launcher.cpp
parenta7e6d919ec602af002c61797d6c5ae5dfc6e6217 (diff)
downloadmongo-944ee09a2aa02f6131748258d67f8a673925c10f.tar.gz
SERVER-21993 Add more diagnostics on fork() failure
Diffstat (limited to 'src/mongo/shell/shell_utils_launcher.cpp')
-rw-r--r--src/mongo/shell/shell_utils_launcher.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
index 3106dee0d83..5b999989edb 100644
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -498,7 +498,13 @@ void ProgramRunner::launchProcess(int child_stdout) {
_pid = ProcessId::fromNative(nativePid);
// Async signal unsafe functions should not be called in the child process.
- verify(nativePid != -1);
+ if (nativePid == -1) {
+ // Fork failed so it is time for the process to exit
+ const auto errordesc = errnoWithDescription();
+ cout << "ProgramRunner is unable to fork child process: " << errordesc << endl;
+ fassert(34363, false);
+ }
+
if (nativePid == 0) {
// DON'T ASSERT IN THIS BLOCK - very bad things will happen
//