[CDRIVER-2056] mongoc_uri_get_option_as_int32() does not allow a localThresholdMS of zero Created: 15/Feb/17  Updated: 30/Jun/20  Resolved: 02/Mar/17

Status: Closed
Project: C Driver
Component/s: libmongoc, uri
Affects Version/s: 1.5.4, 1.6.0
Fix Version/s: 1.5.5, 1.6.1

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-918 localThresholdMS of zero is not suppo... Closed
Related
related to CDRIVER-3730 Do not interpret URI option values of... Backlog
related to CDRIVER-2057 localThresholdMS should default to 15... Closed
is related to CDRIVER-2060 localThresholdMS is not validated as ... Closed

 Description   

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().



 Comments   
Comment by A. Jesse Jiryu Davis [ 02/Mar/17 ]

r1.6: https://github.com/mongodb/mongo-c-driver/commit/dcff494ef62475ea2e5628461997ba5da001aca8

Comment by Githook User [ 02/Mar/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2056: Parse zero values for localThresholdMS URI option
Branch: r1.5
https://github.com/mongodb/mongo-c-driver/commit/da86c48e64293398a0643b08050a6b524909153f

Comment by Githook User [ 28/Feb/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #424 from jmikola/1.5-cdriver-2056

CDRIVER-2056, CDRIVER-2060: Improve localThresholdMS URI option parsing
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/faa52777ba79797ebab1a231c20a413cd2e310cc

Comment by Githook User [ 28/Feb/17 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-2056: Parse zero values for localThresholdMS URI option
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0bc493e5cd000a0e59a1b65d2f0682fbb6bc603a

Comment by Jeremy Mikola [ 16/Feb/17 ]

https://github.com/mongodb/mongo-c-driver/pull/424

Generated at Wed Feb 07 21:14:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.