[SERVER-69901] Fix racy initialization of `CommandInvocationHooks` Created: 22/Sep/22 Updated: 29/Oct/23 Resolved: 11/Oct/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Amirsaman Memaripour | Assignee: | Celina Tala |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Service Arch 2022-10-17 | ||||
| Participants: | |||||
| Linked BF Score: | 5 | ||||
| Description |
|
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. |
| Comments |
| Comment by Githook User [ 10/Oct/22 ] |
|
Author: {'name': 'Celina Tala', 'email': 'celinahtala@gmail.com', 'username': 'celinatala-1'}Message: |