[SERVER-30078] Make a RAII User wrapper Created: 10/Jul/17 Updated: 27/Oct/23 Resolved: 16/May/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Spencer Jackson | Assignee: | DO NOT USE - Backlog - Platform Team |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Currently User* pointers are checked in and out of the AuthorizationManager, by entities which want to access users. The AuthorizationManager will invalidate User*s if their underlying user document is modified. When this happens, consumers should return their User* and get an up to date copy. When the old User*'s refcount reaches 0, the AuthorizationManager releases its memory. We should have an RAII type for Users. Then, consumers cannot forget to release the memory. It should be possible to load and remove these objects into UserSets, without ever letting ownership leak even for a moment. |
| Comments |
| Comment by Spencer Jackson [ 16/May/19 ] |
|
This has been done while LRU caching users. |