[SERVER-77084] Investigate swapLockState() usage Created: 12/May/23 Updated: 29/Sep/23 Resolved: 29/Sep/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Haley Connelly | Assignee: | Haley Connelly |
| Resolution: | Done | Votes: | 0 |
| Labels: | techdebt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Storage Execution
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Execution EMEA Team 2023-07-24, Execution EMEA Team 2023-08-07, Execution EMEA Team 2023-08-21, Execution EMEA Team 2023-09-04, Execution EMEA Team 2023-09-18, Execution EMEA Team 2023-10-02 | ||||||||
| Participants: | |||||||||
| Description |
|
There are places in the code were the Locker attached to the OperationContext is swapped out in favor of another. In the codebase, there is a common pattern of RAII-style classes which execute scoped modifications to the Locker's state. A raw pointer to the Locker is stored in the constructor so the destructor can restore the Locker's original value. However, suppose the Locker is swapped out and discarded for a new Locker within the scope of one of these RAII-style classes. There is a risk of trying to use a pointer to a deleted object in the destructor. |