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

NetworkInterfaceThreadPool is an OutOfLineExecutor that regularly runs things inline

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability

      In the thread pools documentation, we document that NetworkInterfaceThreadPool can run tasks inline:

      Incoming tasks that are scheduled from the NetworkInterface's thread are run immediately. Otherwise they are queued to be run by the NetworkInterface thread when it is available.
      

      At the same time, it's an OutOfLineExecutor. This can bite you when combined with SemiFutures and ExecutorFutures. When fulfilling a promise associated with a SemiFuture, you generally don't expect that you might be forced to run a continuation. However, you can do something like semiFuture.thenRunOn(*executor).getAsync(...) where executor is a ThreadPoolExecutor backed by a NetworkInterfaceThreadPool. If you fulfill the promise associated with semiFuture on a network interface thread, you will be forced to run those continuations inline.

      This has caused bugs, for example SERVER-91869 is a lock-order inversion created by a situation like the above.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ryan.berryhill@mongodb.com Ryan Berryhill
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: