[SERVER-58452] Avoid resetting `ServiceContext` members in `db_repl_coordinator_test` Created: 12/Jul/21 Updated: 17/Sep/21 Resolved: 17/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Amirsaman Memaripour | Assignee: | Amirsaman Memaripour |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
SERVER-51055 aims to ensure setting/getting ServiceContext members (e.g., _fastClockSource) is thread-safe. Resetting a member after reading it, however, violates this guarantee and is not a safe practice. This behavior, even in the context of a single-threaded program, could introduce memory corruptions as an earlier reference to the member (e.g., acquired through getFastClockSource) will be invalidated by resetting the member (e.g., setFastClockSource). This ticket should analyze db_repl_coordinator_test and fix any set-after-get for ServiceContext members (e.g., here). |
| Comments |
| Comment by Amirsaman Memaripour [ 17/Sep/21 ] |
|
This fix won't be necessary after SERVER-59157 and synchronizing ServiceContext getter/setter methods. |