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

ReplicaSetMonitor::check not thread safe wrt _master

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.5, 2.1.1
    • Component/s: Internal Client, Sharding
    • Labels:
      None
    • Operating System:
      ALL

      Description

      It's possible for a thread to notifyFailure(), resetting the _master variable to -1, between the time when the _master variable is checked here and when it is actually used to access the nodes array. We need to acquire _lock to do this safely.

      There may be other issues here - the _check code modifies _master without locks in other places?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              renctan Randolph Tan
              Reporter:
              greg_10gen Greg Studer
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: