[SERVER-58618] Sleep intervals in interruptible_test cause imprecision Created: 16/Jul/21  Updated: 29/Oct/23  Resolved: 29/Jul/21

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

Type: Bug Priority: Major - P3
Reporter: Alex Li Assignee: Alex Li
Resolution: Fixed Votes: 0
Labels: carry-over, servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Service Arch 2021-08-09
Participants:
Linked BF Score: 33
Story Points: 1

 Description   

waitForConditionOrInterruptUntil relies on our defined waitForConditionOrInterruptNoAssertUntil, which sleeps for kPrecision milliseconds before waking to check deadline in a loop. The comment suggests that kPrecision is to deal with inaccuracies, but is used in waitForConditionOrInterruptNoAssertUntil as an interval between sleeps. Then the problem would be that if Date_t::now() == 3:59.99 and deadline == 4:00.00 for example, the next iteration of the loop would be no earlier than Date_t::now() == 4:00.04. Therefore, the time needed for scheduling and timing inaccuracies could cause the end time to be greater than the deadline time. Suggested changes: use sleepFor function instead of a loop + sleep intervals.



 Comments   
Comment by Githook User [ 12/Jul/23 ]

Author:

{'name': 'Alex Li', 'email': 'alex.li@mongodb.com', 'username': 'lia394126'}

Message: SERVER-58618 Sleep intervals removed, sleepFor used in interruptible test

(cherry picked from commit d34cc3d0cce60f9e301cdf2096284297e2d4379d)
Branch: v5.0
https://github.com/mongodb/mongo/commit/6f229af15f6259e290f1c17e7487742601b5602c

Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 28/Jul/21 ]

Author:

{'name': 'Alex Li', 'email': 'alex.li@mongodb.com', 'username': 'alexli12456'}

Message: SERVER-58618 Sleep intervals removed, sleepFor used in interruptible test
Branch: master
https://github.com/mongodb/mongo/commit/d34cc3d0cce60f9e301cdf2096284297e2d4379d

Comment by Githook User [ 16/Jul/21 ]

Author:

{'name': 'Alex Li', 'email': 'alex.li@mongodb.com'}

Message: SERVER-58618 Temporarily disable interruptible_test
Branch: master
https://github.com/mongodb/mongo/commit/eb7e9fd87b70c02ab348fa4cce75baee9566cf9f

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