[SERVER-13407] Default implementations of sleepsecs and sleepmicros do not handle EINTR Created: 29/Mar/14  Updated: 17/Nov/15  Resolved: 05/Nov/15

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

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform C (11/20/15)
Participants:

 Description   

The default implementation of these functions uses nanosleep which can return with EINTR, but this return value is not handled. To be strictly correct, the functions must be written as loops which evaluate whether the intended interval has elapsed if woken with EINTR and continuing with the 'rmtp' interval.

In addition, these function log to std::cout on a non-zero return from nanosleep, which hardly seems helpful.



 Comments   
Comment by Githook User [ 05/Nov/15 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-13407 Use this_thread::sleep_for for sleeps

Rather than using nanosleep on non-windows platforms
Branch: master
https://github.com/mongodb/mongo/commit/0650d80cc4a77b489dd5f52e84d81d7c8c123468

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