- 
    Type:Bug 
- 
    Resolution: Done
- 
    Priority:Critical - P2 
- 
    Affects Version/s: 1.2
- 
    Component/s: None
- 
    None
- 
    Environment:Client app: Linux, Mono 2.10.5
 MongoDB 2.0.0, three server replicaset.
 
 Connection string: mongodb://mongo2.xxxxxx.com,mongo1.xxxxx.com,mongo0.xxxxx.com
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
The Primary server on my replicaset became slow, due to a runaway process on the server.  Eventually it failed altogether, and a new Primary was elected.
My client applications failed to switch to the new Primary.
First of all I got this:
MongoDB.Driver.MongoConnectionException: Unable to connect to the primary member of the replica set: Timeout waiting for a MongoConnection.. ---> System.TimeoutException: Timeout waiting for a MongoConnection.
  at MongoDB.Driver.Internal.MongoConnectionPool.AcquireConnection (MongoDB.Driver.MongoDatabase database) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoServerInstance.Connect (Boolean slaveOk) [0x00000] in <filename unknown>:0 
  — End of inner exception stack trace —
  at MongoDB.Driver.Internal.ReplicaSetConnector.Connect (TimeSpan timeout, ConnectWaitFor waitFor) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoServer.Connect (TimeSpan timeout, ConnectWaitFor waitFor) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoServer.Connect (ConnectWaitFor waitFor) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoServer.ChooseServerInstance (Boolean slaveOk) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoServer.AcquireConnection (MongoDB.Driver.MongoDatabase database, Boolean slaveOk) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCollection.InsertBatch (System.Type nominalType, IEnumerable documents, MongoDB.Driver.MongoInsertOptions options) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCollection.Insert (System.Type nominalType, System.Object document, MongoDB.Driver.MongoInsertOptions options) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCollection.Insert (System.Type nominalType, System.Object document, MongoDB.Driver.SafeMode safeMode) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCollection.Insert (System.Type nominalType, System.Object document) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCollection.Insert[BsonDocument] (MongoDB.Bson.BsonDocument document) [0x00000] in <filename unknown>:0 
  at MsgExchange.Messages.svr_Accounts.Account.UpdateGPS (MsgExchange.Messages.GPS.TrackerMessage trackerMessage) [0x00000] in <filename unknown>:0 ~~
And then this, even after the server problem was fixed, and the Primary was switched back to the original server:
System.TimeoutException: Timeout waiting for a MongoConnection.
  at MongoDB.Driver.Internal.MongoConnectionPool.AcquireConnection (MongoDB.Driver.MongoDatabase database) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoServerInstance.AcquireConnection (MongoDB.Driver.MongoDatabase database) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoServer.AcquireConnection (MongoDB.Driver.MongoDatabase database, Boolean slaveOk) [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCursorEnumerator`1[MongoDB.Bson.BsonDocument].AcquireConnection () [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCursorEnumerator`1[MongoDB.Bson.BsonDocument].GetFirst () [0x00000] in <filename unknown>:0 
  at MongoDB.Driver.MongoCursorEnumerator`1[MongoDB.Bson.BsonDocument].MoveNext () [0x00000] in <filename unknown>:0 
  at MsgServer.Collections.Accounts.clsStoreForwardUtils.SendStoreForward (MsgExchange.Messages.svr_Accounts.Account account) [0x00000] in <filename unknown>:0 ~~
I had to restart my client applications.
- related to
- 
                    CSHARP-406 Deadlock and TimeoutException when acquiring connection. -         
- Closed
 
-         
