[SERVER-67687] PosixTimer::onThreadDetach does not properly compute elapsed time across multiple pauses Created: 30/Jun/22  Updated: 29/Oct/23  Resolved: 08/Jul/22

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

Type: Bug Priority: Major - P3
Reporter: Yujin Kang Park Assignee: Yujin Kang Park
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File attach_detach_test.diff    
Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

attach_detach_test.diff

Sprint: Execution Team 2022-07-11, Execution Team 2022-07-25
Participants:

 Description   

https://github.com/10gen/mongo/blob/330458e81f9baa3f936d639dc3edbe1a8c4c5a32/src/mongo/db/operation_cpu_timer.cpp#L146
 
Not sure how often an operation's client can be detached from the thread, but in case it is detached/reattached more than once, the timer only stores the elapsed time until the last interruption.
 
Probably a matter of accumulating instead of assigning _elapsedBeforeInterrupted.



 Comments   
Comment by Githook User [ 08/Jul/22 ]

Author:

{'name': 'Yu Jin Kang Park', 'email': 'yujin.kang@mongodb.com', 'username': 'ykangpark'}

Message: SERVER-67687: Fix PosixTimer::onThreadDetach to accumulate elapsed time
Branch: master
https://github.com/mongodb/mongo/commit/2e4e65c9209f15f7ab88b8fa681c05be87881b10

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