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

Require GlobalLocks with deadlines to specify interrupt behavior when interrupted

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.0-rc0
    • Affects Version/s: 3.7.3
    • Component/s: Storage
    • None
    • Fully Compatible
    • Storage NYC 2018-04-09, Storage NYC 2018-05-07

      GlobalLocks with deadlines other than Date_t::max() can throw exceptions, but that behavior is not always expected by users, and requires an extra try-catch block. We should add a required argument to the GlobalLock constructor when passing deadlines other than Date_t::max() that allows GlobalLock::isLocked() to return false even if the operation context was interrupted.

      Potential implementations include a) using an enum (LEAVE_UNLOCKED_ON_INTERRUPT, THROW_ON_INTERRUPT) or b) a lambda that users must use to implement the desired behavior when the lock is interrupted.

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: