[SERVER-36663] Make it impossible to mark an operation as killed without holding the Client lock Created: 14/Aug/18 Updated: 29/Oct/23 Resolved: 24/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.8 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Jonathan Ma |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Sprint: | Service Arch 2019-01-28 | ||||
| Participants: | |||||
| Description |
|
The comment for ServiceContext::killOperation says that callers must be holding the Client lock before calling it. It would be helpful if the API for killOperation made it impossible to call without holding the Client lock, to avoid subtle programming errors. |
| Comments |
| Comment by Githook User [ 24/Jan/19 ] |
|
Author: {'username': 'thejonathanma', 'email': 'jonathan.ma@mongodb.com', 'name': 'Jonathan Ma'}Message: |
| Comment by Spencer Brody (Inactive) [ 14/Aug/18 ] |
|
This could be done by making killOperation take a const ref to a lock_guard<Client>, or perhaps by using WithLock if WithLock can be specialized on <Client>. |