GetConnectionPool divide by zero exception

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 0.9
    • Component/s: None
    • None
    • Environment:
      All
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      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) {

            Assignee:
            Robert Stam (Inactive)
            Reporter:
            J W Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: