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

Have ephemeralForTest use std::mutex for protecting its internal data structures

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.7, 3.5.7
    • Component/s: Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v3.4
    • Sprint:
      Storage 2017-04-17, Storage 2017-05-08
    • Linked BF Score:
      0

      Description

      The LockManager was used for ephemeralForTest reader/writer locks, but the LockManager has a limitation on the number of locks that can be taken by one thread at a time. Exceeding that limit now causes an exception to be thrown. Exceptions cannot safely escape catch blocks. `rollback` methods are called from within catch blocks and thus in no circumstances can throw. By implication, rollback methods cannot acquire locks managed by the LockManager.

      The simple fix here is to replace the RW lock with a std[x]::mutex. This will prevent concurrent readers when using ephemeralForTest. However, because the critical section is fast and using a std::mutex is likely to be faster than managing RW locks, there may be no performance loss at all.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: