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

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

    • Query Execution
    • Fully Compatible
    • ALL
    • QE 2025-02-03
    • 6
    • 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@mongodb.com Jan Steemann
            Reporter:
            sophia.tan@mongodb.com Sophia Tan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None