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

Suppress TSAN for LockerImpl::getLockerInfo()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.8.0
    • Affects Version/s: None
    • Component/s: Concurrency
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Execution Team 2020-10-05
    • 11

      The thread sanitizer build variant has caught a couple of data race scenarios that involve the Locker::getLockerInfo() method. So far, these data races involve diagnostic commands such as currentOp or FTDC.

      1. The first data race in LockerImpl::getLockerInfo() involves iterating over the _requests map and accessing the lock requests mode here. The problem here is that we insert the lock request into the map here with mode MODE_NONE. Now, this lock request is accessible to the map iterator in LockerImpl::getLockerInfo(), but later on, as we're still acquiring the lock we change the lock requests mode here without any synchronization.
      2. The second data race involving LockerImpl::getLockerInfo() involves copying the locker info stats here. While the copy is happening via this method, a new global lock acquisition can come in and increment the statistics, calling this. This is problematic because there is no synchronization between incrementing the counter and copying its value.

      Based on these findings, it would be wise to audit LockerImpl::getLockerInfo() for any other data races the thread sanitizer may not have discovered yet.

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: