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

Simplify Notifyable/Waitible/ClockSource/Baton/Condvar hierarchy

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability

      Interruptible waiting functionality implementation is currently split across the following types: 

      • waitable
      • notifyable
      • clocksource
      • baton
      • stdx::condition_variable
      • interruptible
      • operationContext

      Waitable is a child class of Notifyable, and Baton is a child class of Waitable. ConditionVariable is a friend of Notifyable, and Waitable is a friend of ConditionVariable. Waitable only declares static methods used by ClockSource and OperationContext, except for two essential virtual functions that it declares that Baton must implement. These virtual functions are then called via a type-erased closure inside of condition variable.

       

      The complicated relationships between these classes and division of functionality makes reading and understanding the code difficult and increases the risk that changes introduce subtle bugs due to the dependencies that are non-obvious. We should spend some time attempting to reduce the number of classes, inheritance structures, and friendships used to implement waitable interruptibility, to present a simpler interface that is more easily unit-testable. 

            Assignee:
            Unassigned Unassigned
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: