PosixTimer::onThreadDetach does not properly compute elapsed time across multiple pauses

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Show
      attach_detach_test.diff
    • Execution Team 2022-07-11, Execution Team 2022-07-25
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

        1. attach_detach_test.diff
          1 kB
          Yujin Kang Park

            Assignee:
            Yujin Kang Park
            Reporter:
            Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: