[SERVER-68528] Remove use of shared_mutex from SchedulingTicketHolder Created: 03/Aug/22 Updated: 29/Oct/23 Resolved: 08/Sep/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.2.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Jordi Olivares Provencio |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Sprint: | Execution Team 2022-09-05, Execution Team 2022-09-19 | ||||
| Participants: | |||||
| Linked BF Score: | 120 | ||||
| Description |
|
The `SchedulingTicketHolder` type uses `std::shared_mutex`, which is not generally allowed in production mongodb code. If a reader-writer mutex is required, the LockManager's ResourceMutex type is the currently recommended type. |
| Comments |
| Comment by Andy Schwerin [ 14/Sep/22 ] |
|
Thanks jordi.olivares-provencio@mongodb.comand geert.bosch@mongodb.comfor publishing the benchmark and the reasoning for why shared_mutex is appropriate here. I learned things! |
| Comment by Githook User [ 08/Sep/22 ] |
|
Author: {'name': 'Jordi Olivares Provencio', 'email': 'jordi.olivares-provencio@mongodb.com', 'username': 'jordiolivares'}Message: |
| Comment by Geert Bosch [ 07/Sep/22 ] |
|
We talked and agree that both ResourceMutex is not appropriate here, and that usual reasons for avoiding std::shared_mutex do not apply:
So, it is ok for the TicketHolder to use the shared_mutex here with an appropriate comment. |