Attach client strand before releasing the opCtx in AsyncCommandExecution tests

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • v5.2, v5.1, v5.0
    • Service Arch 2022-2-21
    • 15
    • 3
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The main thread in AsyncCommandExecution tests may attempt to release the opCtx owned by an instance of ExecutionContext (see here and here) while a worker thread is using the client strand to fulfill a promise. This would cause a data-race, as the thread that is releasing the opCtx does not have the client strand attached to it.

      We should reorganize the test so that the client strand is always attached to the thread that destroys the opCtx.

              Assignee:
              Amirsaman Memaripour
              Reporter:
              Amirsaman Memaripour
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: