[SERVER-54961] ReshardingMetrics getOperationElapsedTime needs to lock Created: 04/Mar/21  Updated: 29/Oct/23  Resolved: 26/Mar/21

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Kshitij Gupta
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-autocommits
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-04-05
Participants:
Story Points: 1

 Description   

boost::optional<Milliseconds> getOperationElapsedTime() const.

This function was added recently and accesses the runningOperation TimeInterval

https://github.com/mongodb/mongo/blob/fdaf29180e2c4218c99544bf377fc05dcc378fc5/src/mongo/db/s/resharding/resharding_metrics.cpp#L381

without acquiring a lock on _mutex as required by

https://github.com/mongodb/mongo/blob/fdaf29180e2c4218c99544bf377fc05dcc378fc5/src/mongo/db/s/resharding/resharding_metrics.h#L123 

 



 Comments   
Comment by Githook User [ 26/Mar/21 ]

Author:

{'name': 'Kshitij Gupta', 'email': 'kshitij.gupta@mongodb.com', 'username': 'kshitijng'}

Message: SERVER-54961: ReshardingMetrics getOperationElapsedTime needs to lock.
Branch: master
https://github.com/mongodb/mongo/commit/c4174b655601ab8a374920247bbf758a34079ca2

Comment by Kshitij Gupta [ 24/Mar/21 ]

CR: https://mongodbcr.appspot.com/757680002/

Generated at Thu Feb 08 05:35:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.