[CSHARP-448] MongoServer.Ping() has possible race condition Created: 18/Apr/12  Updated: 02/Apr/15  Resolved: 20/Apr/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4.1
Fix Version/s: 1.4.2

Type: Bug Priority: Minor - P4
Reporter: Aristarkh Zagorodnikov Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: 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.



 Comments   
Comment by Craig Wilson [ 19/Apr/12 ]

Pull request submitted.

Generated at Wed Feb 07 21:36:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.