[GODRIVER-1226] localThresholdMS does not default to 15 ms Created: 10/Aug/19  Updated: 28/Oct/23  Resolved: 13/Aug/19

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: 1.0.4
Fix Version/s: 1.1.0

Type: Bug Priority: Major - P3
Reporter: David Bartley Assignee: Kristofer Brandow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change

 Description   

There's a defaultLocalThreshold constant defined (to 15 ms) but it's completely unreferenced. It seems like the intention was to make Client.localThreshold default to defaultLocalThreshold, possibly in newClient.

Confusingly, there is one usage of description.LatencySelector(15 * time.Millisecond), in Operation.selectServer, but my read of that code is that it would almost never come into play, since a selector will almost always be specified. Either way, it seems like that should use defaultLocalThreshold, rather than hardcoding 15 * time.Millisecond.

I suspect all of this means that localThresholdMS ends up defaulting to 0 ms.



 Comments   
Comment by Githook User [ 13/Aug/19 ]

Author:

{'name': 'Kris Brandow', 'email': 'kris@mongodb.com', 'username': 'skriptble'}

Message: Properly set default local threshold in Client

GODRIVER-1226

Change-Id: I7fcc5b09a49b80908d04f3c4fde75b6958748b5f
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/e25bb908c77dadf6906c124937cb5f112c15d099

Comment by Kristofer Brandow (Inactive) [ 12/Aug/19 ]

Code review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/464903.

Comment by Kristofer Brandow (Inactive) [ 12/Aug/19 ]

Hi bartle,

Thanks for catching this. Definitely a bug from that patch, thanks for finding it.

--Kris

Comment by David Bartley [ 10/Aug/19 ]

Indeed, prior to https://github.com/mongodb/mongo-go-driver/commit/32946b1f8b9412a6a94e68ff789575327bb257cf Client.localThreshold would have been set to defaultLocalThreshold in newClient.

Generated at Thu Feb 08 08:35:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.