[SERVER-83520] Fix data race with CurOp if a command has a clientKeyOperation field Created: 21/Nov/23  Updated: 06/Dec/23  Resolved: 06/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Erwin Pe Assignee: Ryan Berryhill
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2023-11-27, Service Arch 2023-12-11
Participants:
Linked BF Score: 3

 Description   

If a command with a clientOperationKey field and a $currentOp aggregation operation are running at the same time, there's a potential data race on the OperationContext member, _opKey, where the service entry point thread writes it here (without taking the Client lock), while the CurOp thread reads it here (while holding the Client lock).



 Comments   
Comment by Githook User [ 06/Dec/23 ]

Author:

{'name': 'Ryan Berryhill', 'email': 'ryan.berryhill@mongodb.com', 'username': 'ryanberryhill'}

Message: SERVER-83520 Take client lock when setting operation key

GitOrigin-RevId: ffe9d98d28040345da83907edad6bac729766b32
Branch: master
https://github.com/mongodb/mongo/commit/517a38489bdac4150315985e4b3f7827e43dd82e

Generated at Thu Feb 08 06:52:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.