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

NullReferenceException on lost primary

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2
    • Affects Version/s: 1.2
    • Component/s: None
    • None
    • Environment:
      git version d7ce7f2ee560183d8031

      3-server replica set (primary, slave, arbiter). Primary steps down, the next query (actually any queries) fail with NullReferenceException with the following stack trace:
      MongoDB.Driver.DLL!MongoDB.Driver.MongoServerInstance.AcquireConnection(MongoDB.Driver.MongoDatabase database) Line 183 + 0x8 bytes
      MongoDB.Driver.DLL!MongoDB.Driver.MongoServer.AcquireConnection(MongoDB.Driver.MongoDatabase database, bool slaveOk) Line 893 + 0xf bytes
      MongoDB.Driver.DLL!MongoDB.Driver.MongoCursorEnumerator<System.__Canon>.AcquireConnection() Line 184 + 0x42 bytes
      MongoDB.Driver.DLL!MongoDB.Driver.MongoCursorEnumerator<MongoDB.Bson.BsonDocument>.GetFirst() Line 194 + 0xc bytes
      MongoDB.Driver.DLL!MongoDB.Driver.MongoCursorEnumerator<System.__Canon>.MoveNext() Line 126 + 0x8 bytes

      It appears that connectionPool is null, probably because MongoServerInstance.Disconnect due to the connection error. Might be related to CSHARP-217 and CSHARP-233. I'll post more information later.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: