AsyncResultsMerger is creating an RCR with an OperationContext from a different thread

XMLWordPrintableJSON

    • Query Execution
    • Fully Compatible
    • ALL
    • QE 2025-02-03
    • 6
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It is not safe to call scheduleRemoteCommand with an RCR with an OperationContext from a different thread, unless there is additional synchronization that ensures the OperationContext isn't destroyed. Refer to SERVER-84514 .

      Unfortunately, the AsyncResultsMerger breaks the contract. When it asks for next batch  handle batch response from from remote nodes, it call scheduleRemoteCommand with an RCR with an OperationContext from an executor thread instead of the client thread which owns the OperationContext.  It also causes ThreadSanitizer reports an false positive data race when call `opCtx.getComment()` in the RCR constructor in the executor thread.

              Assignee:
              Jan Steemann
              Reporter:
              Sophia Tan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: