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

GetConnectionPool divide by zero exception

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 0.9
    • None
    • None
    • All
    • Fully Compatible

    Description

      The GetConnectionPool function in MongoServer.cs in the driver will attempt to divide by zero is no slaves are available and SlaveOk is set on the connection.

      The secondary connection pool should be bypassed if there are no servers in it (e.g. all except one node in a replicaset is available).

      Adding an additional check should revert all reads to the master if no slaves are available:
      if (slaveOk && secondaryConnectionPools != null && secondaryConnectionPools.Count > 0) {

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            derfel J W Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: