summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2012-10-23 11:02:35 -0400
committerAndy Schwerin <schwerin@10gen.com>2012-10-23 16:25:46 -0400
commit5589eb5e541eecc80cb94b54139b289c8e6ce06c (patch)
treed78da7e052fdbec32eb2c77b4f30a7b9caa2bb42 /src/mongo
parentffd8aec961a751aa5adfa79070f26cc21a560ce5 (diff)
downloadmongo-5589eb5e541eecc80cb94b54139b289c8e6ce06c.tar.gz
Fix up fail points to be compatible with parsing command line before running global initializers.
SERVER-7332
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/fail_point_service.cpp8
-rw-r--r--src/mongo/db/fail_point_service.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/fail_point_service.cpp b/src/mongo/db/fail_point_service.cpp
index ea2fa4553b6..a7d8cee1a40 100644
--- a/src/mongo/db/fail_point_service.cpp
+++ b/src/mongo/db/fail_point_service.cpp
@@ -144,12 +144,15 @@ namespace mongo {
scoped_ptr<FaultInjectCmd> _faultInjectCmd(NULL);
scoped_ptr<FailPointRegistry> _fpRegistry(NULL);
- MONGO_INITIALIZER(FailPointRegistry)(::mongo::InitializerContext* context) {
+ MONGO_INITIALIZER(FailPointRegistry)(InitializerContext* context) {
_fpRegistry.reset(new FailPointRegistry());
return Status::OK();
}
- MONGO_INITIALIZER_GROUP(AllFaillPointsRegistered, (), ());
+ MONGO_INITIALIZER_GENERAL(AllFailPointsRegistered, (), ())(InitializerContext* context) {
+ _fpRegistry->freeze();
+ return Status::OK();
+ }
FailPointRegistry* getGlobalFailPointRegistry() {
return _fpRegistry.get();
@@ -157,6 +160,5 @@ namespace mongo {
void enableFailPointCmd() {
_faultInjectCmd.reset(new FaultInjectCmd);
- _fpRegistry->freeze();
}
}
diff --git a/src/mongo/db/fail_point_service.h b/src/mongo/db/fail_point_service.h
index 0ef76afb735..608812d687e 100644
--- a/src/mongo/db/fail_point_service.h
+++ b/src/mongo/db/fail_point_service.h
@@ -41,7 +41,7 @@ namespace mongo {
* never in a block with limited scope (ie, inside functions, loops, etc.)
*/
#define MONGO_FP_DECLARE(fp) FailPoint fp; \
- MONGO_INITIALIZER_GENERAL(fp, ("FailPointRegistry"), ("AllFaillPointsRegistered")) \
+ MONGO_INITIALIZER_GENERAL(fp, ("FailPointRegistry"), ("AllFailPointsRegistered")) \
(::mongo::InitializerContext* context) { \
return getGlobalFailPointRegistry()->addFailPoint(#fp, &fp); \
}