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

add check for Global resource lock state to OperationContext::waitForConditionOrInterrupt()

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
    • Execution Team 2021-11-01, Execution Team 2021-11-15, Execution Team 2021-12-27, Execution Team 2022-01-10, Execution Team 2022-01-24

      It is generally an anti-pattern to be holding a lock on either the Global or RSTL resources when waiting on a condition variable through the.OperationContext.

      There is currently no programmatic way to enforce this convention, which has led to issues such as SERVER-48617, in IndexBuildsCoordinatorMongod::startIndexBuild().

      We should look into introducing in invariant to enforcing this convention for most usages of OperationContext as a condition variable. There will be a few exceptions to consider - one such case is in the LockManager's internal lock acquisition logic.

            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            benety.goh@mongodb.com Benety Goh
            0 Vote for this issue
            4 Start watching this issue