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

Don't hold mutex while trying to establish connection to replica sets

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.1
    • Component/s: Internal Client
    • None
    • Fully Compatible

      There are a couple of places inside ReplicaSetMonitor that holds the _setsLock mutex while creating a new connection to the seed nodes of the set. This can be problematic in the case when the monitor decides to stop monitoring a set after getting continuous errors (basically it assumes that the shard has been removed), then another request will try to talk to the removed set. This will then prompt the monitor to recreate it from the cached seedlist. And this is done while holding the mutex. If it takes time for the set to error out, then it will be blocking all the other threads who wants to use the monitor to talk to the other sets as well.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: