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

Fix LatchAnalyzerTest

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Service Arch 2019-12-02, Service Arch 2019-12-16
    • 0

      It seems that Windows doesn't allow us to dtor a locked mutex (that behavior is in fact UB). This implies that failures during lock could be hidden by consequential failures during unlock. We should:

      • invariant that Mutex is unlocked on dtor via a boolean flag
      • allow turning on and off the latch analyzer
      • alter the test to have a stack of lock and unlock events

      As an example for LatchAnalyzerTest::AddValidWasAbsent, we would:

      l2.acquire();
      l1.acquire();
      {
          LatchAnalyzerDisabledBlock block;
          l1.release();
          l2.release();
      }
      

            Assignee:
            rahul.sundararaman@mongodb.com Rahul Sundararaman (Inactive)
            Reporter:
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: