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

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.3, 4.1.2
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      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

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: