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

Make recursion depth thread-local in ServiceExecutor tests

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Service Arch 2020-08-10
    • 0

      The atomic variable used in ServiceExecutorFixedFixture::FlattenRecursiveScheduledTasks (see here) to track the recursion depth should be replaced by a thread-local integer, making it safe for multiple executor threads to run tasks without concurrently bumping up the recursion depth.

      Having a thread-local variable to track recursion depth is necessary since another executor thread (i.e., exec2) may start executing a task immediately after it's been scheduled by another thread (i.e., exec1), making it appear as the thread that scheduled the task (exec1) is executing it recursively.

            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: