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

Fix racy initialization of `CommandInvocationHooks`

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2022-10-17
    • 5

      CommandInvocationHooks are defined as a decoration on ServiceContext and define server-specific behavior that should run before and after running commands.

      Accesses to this decoration are not synchronized, so initializing it after its first use may case data races. For example, mongod initializes these hooks from here, however, other threads may access the hooks as part of running commands before it is initialized (e.g., ReadThroughCache.

      This ticket should address this data race, either by proposing an alternative initialization order or adopting synchronization primitives.

            Assignee:
            celina.tala@mongodb.com Celina Tala
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: