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

AsyncResultsMerger can block networking threads in callbacks

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 3.2.20, 3.4.15
    • Component/s: Internal Code
    • None
    • Sharding
    • ALL

      • The AsyncResultsMerger holds a lock while it runs callbacks, and while it calls nextEvent()
      • running askForNextBatch_inlock does repl targetting
      • repl targetting can hang for up to 20 seconds

      The bad scenario is:

      • Bunch of remotes are established
      • The first host suceeds in targetting and runs
      • The second host cannot satisfy it's read pref, blocking holding a lock in nextEvent()
      • The first request comes back, blocking on the mutex waiting to call handleBatchResponse

      If you have enough of those, you saturate all the background networking threads and hang your mongos.

      This isn't a problem in 3.6 and later because targetting was moved into the ARS and SERVER-34582 fixes the problem there

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            mira.carey@mongodb.com Mira Carey
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: