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

Always invoke onReply callback out-of-line for exhaust commands in NetworkInterfaceTL

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • Service Arch 2023-06-12
    • 147

      In SERVER-53084, we ensured that the onFinish callback that is run whenever an ordinary RPC through the network interface completes (either via success or cancellation/timeout/error) runs out-of-line from the actual completion event. That ensured that code that might complete RPC requests (i.e. by cancelling them) didn't have to worry about holding shared resources that the completion-callbacks might also want to acquire. 

      However, for exhaust commands scheduled through the NetworkInterfaceTL, it is still possible for the completion-callback to run in-line with the completion event (i.e. cancellation can invoke the completion callback in-line). This can cause deadlocks when the cancelling code holds resources the callback wants to acquire. We should harden the API to guarantee that the onReply callback for exhaust commands is never run in-line with the completion event, which should simply schedule it. 

            Assignee:
            george.wangensteen@mongodb.com George Wangensteen
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: