Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-448

MongoServer.Ping() has possible race condition

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.4.2
    • 1.4.1
    • None
    • None
    • Fully Compatible

    Description

      public virtual void Ping()
      {
      foreach (var instance in _instances.ToArray())

      { instance.Ping(); }

      }

      _instances.ToArray() isn't thread safe, I guess that iterating over the result of MongoServer.Instances property (that does locking inside) should be better.

      Attachments

        Activity

          People

            craig.wilson@mongodb.com Craig Wilson
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: