-
Type: Bug
-
Resolution: Duplicate
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: SDAM
-
None
-
Go Drivers
Detailed steps to reproduce the problem?
Hello all! Hope everyone is well
Dan Gottlieb discovered what we think is a bug in the polling logic for server monitoring. In particular, when we upgraded to any version of the Go driver beyond (and including) v1.13.0, we found that our DBs got hit with an excessive amount of heartbeats (tens of thousands per second). We traced the issue to this commit: reverting that commit brings heartbeats back to a much more reasonable frequency.
We are wondering if there is a small typo in this predicate. Instead of:
if isStreamable(s) || connectionIsStreaming || transitionedFromNetworkError { continue }
Should it be:
if (isStreamable(s) && connectionIsStreaming) || transitionedFromNetworkError { continue }
The former (what's in the driver currently) seems to continue and not wait for a heartbeat interval if streaming is possible for the current server OR the connection we're using is streaming. Shouldn't we only continue and not wait for a heartbeat interval if streaming is possible for the current server AND the connection we're using is streaming?
Thanks, and let me know if you need any other information.
Definition of done: what must be done to consider the task complete?
Change the predicate as described above.
The exact Go version used, with patch level:
$ go version
go version go1.22.5 linux/amd64
The exact version of the Go driver used:
$ go list -m go.mongodb.org/mongo-driver
v1.13.0.
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
Hosted, version 6.0, replica-set (and sharded in some cases).
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
Linux (probably ubuntu; I can check distro + version if this is important).
- duplicates
-
GODRIVER-3255 Heartbeat flood if K_SERVICE or similar env is set
- Closed