Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2056

mongoc_uri_get_option_as_int32() does not allow a localThresholdMS of zero

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.5, 1.6.1
    • Affects Version/s: 1.5.4, 1.6.0
    • Component/s: libmongoc, uri
    • None

      The server selection spec states the following:

      To always select the server with the lowest RTT, users should use mode 'nearest' without tag_sets or maxStalenessSeconds and set localThresholdMS to zero.

      mongoc_topology_new() initializes its copy of localThresholdMS by calling mongoc_uri_get_option_as_int32(). which does not respect a zero value and instead returns the fallback of 15ms (as documented).

      One solution may be to create a separate getter that respects zero, as was done with _mongoc_uri_get_max_staleness_option().

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: