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

ServerStatus needs initializer[s].

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • Service Arch 2021-10-04
    • 30
    • 2

    Description

      The ServerStatus command implementation has two variables here that are evaluated upon every run. _started is const so it cannot race but it is set pre-main which isn't quite right. _runCalled however is called upon first run(). Unfortunately, run() has no synchronization guarantees.

      So we should replace _runCalled with _sectionsLocked, make a MONGO_INITIALIZER to set _sectionsLocked, and use invariant instead of verify here.

      It's probably also worthwhile to move _started to be a ServiceContext Decoration+ConstructorAction. It is currently records a time before main(). Instead, it should record a time after main() after the ServiceContext used with ServerStatus is constructed.

       

      Acceptance criteria:

      Update the ServerStatus command so that updating the _runCalled data member is not racy.

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: