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

MongoServer.Ping() has possible race condition

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.4.2
    • Affects Version/s: 1.4.1
    • Component/s: None
    • None
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: