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

ClockSource::waitForConditionUntil calls wait_until with a mocked deadline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.3
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      • Get a windows-64-vs2019-nonprod spawnhost
      • Build and run dbtest or util_test
      • Watch the memory usage go crazy.
    • Sprint:
      Service Arch 2020-01-27

      Description

      While undertaking some experiments with VS2019 (it cuts our build times in half), we found that several unit tests and the dbtests had very rapid memory leaks.

      Investigation has revealed ClockSource::waitForConditionUntil is passing a mocked deadline to a wait_until call on a system condition_variable that is using the system clock. Since the mocked values are very small, the wait is skipped. The erroneous line is here: https://github.com/mongodb/mongo/blob/b157e332ffe0963c8c503bb9ecb380fd158e0871/src/mongo/util/clock_source.cpp#L87

      The result is that we spin hard in https://github.com/mongodb/mongo/blob/b157e332ffe0963c8c503bb9ecb380fd158e0871/src/mongo/util/clock_source.h#L117-L120, and each iteration allocates a new AlarmInfo .
      One truly curious thing is why this only appears to be an issue on the VS2019 images, and doesn't seem to cause problems on the VS2017 builders.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ben.caimano Benjamin Caimano (Inactive)
              Reporter:
              acm Andrew Morrow
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: