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

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

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch
    • ALL
    • 6

      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:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            sophia.tan@mongodb.com Sophia Tan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: