-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
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.