Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36258

Perform construction of ServiceContext after execution of mongo initializers, not during

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.0.3, 4.1.2
    • Internal Code
    • None
    • Fully Compatible
    • Platforms 2018-07-30

    Description

      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.

      Attachments

        Activity

          People

            henrik.edin@mongodb.com Henrik Edin
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: