-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
Platforms 2018-07-30
The "global" instance of ServiceContext is currently created by mongo initializers in all processes that link service_context.cpp. However, it's illegal to create threads inside mongo initializers. Also, test cases are supposed to construct their own ServiceContext per test case using the ServiceContextTest fixture or one of its relatives, so having the global one leads to programming errors in tests.
This task is to remove the MONGO_INITIALIZER(ServiceContext) and instead manually instantiate the ServiceContext in mongos, mongod, and the embedded library, and then to fix the fallout.