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

ReplicaSetMonitor::check not thread safe wrt _master

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.0.5, 2.1.1
    • Internal Client, Sharding
    • None
    • 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

              randolph@mongodb.com Randolph Tan
              greg_10gen Greg Studer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: