Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15272

Improve sleepsecs()/sleepmicros() error reporting

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 2.7.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Linux

      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;
              }

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            davide.italiano Davide Italiano
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: