[SERVER-15272] Improve sleepsecs()/sleepmicros() error reporting Created: 16/Sep/14  Updated: 28/Oct/14  Resolved: 16/Sep/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.7.6
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Davide Italiano Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux


Participants:

 Description   

These two functions both call nanosleep() internally.
If nanosleep fails, this is logged, but it's not very informational to diagnose where the problem is. Log example:

2014-09-16T18:18:26.503+0000 [initandlisten] connection accepted from 54.68.48.43:54328 #32 (24 connections now open)
nanosleep failed
2014-09-16T18:18:37.149+0000 [conn24] insert test.foo12 ninserted:1 keyUpdates:0 numYields:0 locks(micros) w:31 131ms

The following could be enhanced to include at least errno, and maybe a backtrace to understand where nanosleep failed. The latter coul be probably showed only at a different log severity, let's say >= 2.

        if ( nanosleep( &t , &out ) ) {
            std::cout << "nanosleep failed" << std::endl;
        }



 Comments   
Comment by Davide Italiano [ 16/Sep/14 ]

Dup of SERVER-13407

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