[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:
Depends
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: SERVER-36663 Prevent killOperation from running without lock
Branch: master
https://github.com/mongodb/mongo/commit/aec398437d55ae1d88efd2439118dc8b978154e2

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>.

Generated at Thu Feb 08 04:43:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.