diff options
author | Andy Schwerin <schwerin@10gen.com> | 2012-10-23 11:02:35 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2012-10-23 16:25:46 -0400 |
commit | 5589eb5e541eecc80cb94b54139b289c8e6ce06c (patch) | |
tree | d78da7e052fdbec32eb2c77b4f30a7b9caa2bb42 /src/mongo | |
parent | ffd8aec961a751aa5adfa79070f26cc21a560ce5 (diff) | |
download | mongo-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.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/fail_point_service.h | 2 |
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); \ } |