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

Make destruction of ServiceExecutorFixed deterministic

    • Fully Compatible
    • ALL
    • Service arch 2020-09-07, Service arch 2020-09-21
    • 0

      ServiceExecutorFixed associates each executor thread with an instance of ExecutorThreadContext (defined here), which enables executor threads to keep track of the recursion depth and maintain the number of running executor threads. Each instance of ExecutorThreadContext has a weak-ptr to its corresponding service executor, which is promoted to a shared-ptr at the time of initialization and termination of the executor thread (see here).

      As a result, executor threads could reference the corresponding service executor at times (through the aforementioned shared-ptr), which complicates reasoning about the destruction time of the service executor object. This is especially problematic in this test, which relies on the destruction of the service executor object before leaving the test.

      This ticket should provide the means to enforce/ensure destruction of the service executor object, at least in the context of unit-tests. A possible solution is introducing a failpoint that blocks the caller until the last executor thread returns.

            Assignee:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: