diff options
author | Mathias Stearn <mathias@10gen.com> | 2014-05-05 14:41:59 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2014-05-06 14:58:51 -0400 |
commit | 482bf3dbfcd78372c5483c6d2fc5b026b5a51d55 (patch) | |
tree | 22abd6897820ee3b2961c6823190bc6e2a81a729 | |
parent | 688b0585cb2cc0cdeffb019f88643b2340c55d17 (diff) | |
download | mongo-482bf3dbfcd78372c5483c6d2fc5b026b5a51d55.tar.gz |
Improve debugging for Windows RunMongoProgram errors
-rw-r--r-- | src/mongo/shell/shell_utils_launcher.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp index 58f65570860..8b153858ab7 100644 --- a/src/mongo/shell/shell_utils_launcher.cpp +++ b/src/mongo/shell/shell_utils_launcher.cpp @@ -476,12 +476,17 @@ namespace mongo { verify(registry._handles.count(pid)); HANDLE h = registry._handles[pid]; - if (block) - WaitForSingleObject(h, INFINITE); + if (block) { + if (WaitForSingleObject(h, INFINITE)) { + log() << "WaitForSingleObject failed: " << errnoWithDescription(); + } + } DWORD tmp; if(GetExitCodeProcess(h, &tmp)) { if ( tmp == STILL_ACTIVE ) { + if (block) + log() << "Process is STILL_ACTIVE even after blocking"; return false; } CloseHandle(h); @@ -491,6 +496,7 @@ namespace mongo { return true; } else { + log() << "GetExitCodeProcess failed: " << errnoWithDescription(); return false; } #else @@ -538,7 +544,7 @@ namespace mongo { ProgramRunner r( a ); r.start(); boost::thread t( r ); - int exit_code; + int exit_code = -123456; // sentinel value wait_for_pid( r.pid(), true, &exit_code ); if ( r.port() > 0 ) { registry.deletePort( r.port() ); @@ -553,7 +559,7 @@ namespace mongo { ProgramRunner r( a ); r.start(); boost::thread t( r ); - int exit_code; + int exit_code = -123456; // sentinel value wait_for_pid(r.pid(), true, &exit_code); registry.deletePid( r.pid() ); return BSON( string( "" ) << exit_code ); |