summaryrefslogtreecommitdiff
path: root/src/mongo/db/instance.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2014-03-19 11:30:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2014-03-19 17:22:55 -0400
commit7be64ae7568306dcbf75335a5e80793f4ce1268d (patch)
treef95d27c7a9e0e8dbd5df53e3c0163f7c22e4518e /src/mongo/db/instance.cpp
parent47ce3aebb48d9b9191584e3173774e29a0a3808c (diff)
downloadmongo-7be64ae7568306dcbf75335a5e80793f4ce1268d.tar.gz
SERVER-13033: Static Initalizer race condition with CreateDirectClient and server-side Javascript
Diffstat (limited to 'src/mongo/db/instance.cpp')
-rw-r--r--src/mongo/db/instance.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index fa5f6f67612..d8caf40827d 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -81,6 +81,7 @@
#include "mongo/platform/process_id.h"
#include "mongo/s/d_logic.h"
#include "mongo/s/stale_exception.h" // for SendStaleConfigException
+#include "mongo/scripting/engine.h"
#include "mongo/util/fail_point_service.h"
#include "mongo/util/file_allocator.h"
#include "mongo/util/gcov.h"
@@ -1037,6 +1038,14 @@ namespace {
return new DBDirectClient();
}
+ MONGO_INITIALIZER(CreateJSDirectClient)
+ (InitializerContext* context) {
+
+ directDBClient = createDirectClient();
+
+ return Status::OK();
+ }
+
mongo::mutex exitMutex("exit");
AtomicUInt numExitCalls = 0;