summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
diff options
context:
space:
mode:
authorMatt Kneiser <matt.kneiser@mongodb.com>2022-07-05 17:09:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-07 18:26:31 +0000
commitc44db4ac9d0c4c368835dac9f2fbd5869d885f17 (patch)
treec07de8fbd279573725d877619f263a684ec420f4 /src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
parent2f2dc04da0c7fd853a2ff68c245c5f6e28f50fa1 (diff)
downloadmongo-c44db4ac9d0c4c368835dac9f2fbd5869d885f17.tar.gz
SERVER-9434 Audit and Normalize Process Exit Codes
- Put all references to ExitCode enumerators under an enum class to namespace all the enumerators and avoid polluting the mongo namespace with possible naming collisions. - Added magic-number exit codes to exit_code.h like 50 & 51 (LauncherMiddleError & LauncherError respectively). - Reserved a range of exit codes to account for FreeBSD's usage of 64-78. - Renamed all enums with removal of EXIT_ which could conflict or get confused with built-in macros. - camelCased all ExitCode enum values. - Added the generic - ExitCode::fail - for returning 1 as failure. - Added explicit dependency on the exit_code.h header for all files using ExitCode's. - Removed all references to implementation-defined exit codes like EXIT_FAILURE and EXIT_SUCCESS. - Narrowed return values of the shell's undocumented quit() argument to portable values within 0-255, 0/ExitCode::clean otherwise. - Deprecated 8 unused ExitCode's - java - oomMalloc - oomRealloc - fs - clockSkew - windowsServiceStop - possibleCorruption - test - Wrapped the 2 Windows-only ExitCode's in #ifdef's - ntServiceError - windowsServiceStop
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 472e1225d5a..cd1bef9b1e5 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -35,6 +35,7 @@
ID, DLEVEL, {logv2::LogComponent::kReplicationRollback}, MESSAGE, ##__VA_ARGS__)
#include "mongo/platform/basic.h"
+#include "mongo/util/exit_code.h"
#ifdef _WIN32
#define NVALGRIND
@@ -725,7 +726,7 @@ void WiredTigerKVEngine::cleanShutdown() {
"initialDataTimestamp and enableMajorityReadConcern is false",
"stableTimestamp"_attr = stableTimestamp,
"initialDataTimestamp"_attr = initialDataTimestamp);
- quickExit(EXIT_SUCCESS);
+ quickExit(ExitCode::clean);
}
if (_fileVersion.shouldDowngrade(!_recoveryTimestamp.isNull())) {