-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: CMAP
-
None
-
None
-
Go Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Detailed steps to reproduce the problem?
The CMAP spec says:
When a pool is created, its state MUST initially be set to "paused". Even if minPoolSize is set, the pool MUST NOT begin being populated with Connections until it has been marked as "ready". SDAM will mark the pool as "ready" on each successful check.
The Go driver marks ready from *topology.Server.Connect() with no check having succeeded, the argument being that accepting that a misconfigured server may spawn doomed connections until the first check fails, as noted in the PR description:
proactive pool.ready() behavior exists to improve startup usability/perf, and that stricter spec compliance should happen in a separate ticket
However, there are a few reasons why this doesn’t matter:
- With minPoolSize = 0 (the default), there's no background population at all.
- The overlap benefit only exists if a user explicitly sets minPoolSize > 0, and even then it saves a single connection-handshake RTT, once, on the first operation.
- This does not affect mongo.Connect() which stays non-blocking, which would be breaking. It only affects operations executed on the subsequent mongo.Client.
Definition of done: what must be done to consider the task complete?
Do not mark the pool as ready in *topology.Server.Connect() except for when load balancing or when the monitor is disabled:
if s.cfg.loadBalanced || s.cfg.monitoringDisabled { return s.pool.ready() }
and then unskip the following test:
TestUnifiedSpec/server-discovery-and-monitoring/tests/unified/pool-clear-min-pool-size-error.json/Pool_is_not_cleared_on_handshake_error_during_minPoolSize_population
Additionally, we should add a test ensuring mongo.Connect() does not block if the first heartbeat never succeeds.
The exact Go version used, with patch level:
N/A
The exact version of the Go driver used:
N/A
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
N/A
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
N/A
Security Vulnerabilities
None
- depends on
-
GODRIVER-3829 Update skipped CMAP spec tests TODOs with the current ticket
-
- Closed
-
- fixes
-
GODRIVER-3920 Fix pool-clear-min-pool-size-error.json failure
-
- In Code Review
-
- is caused by
-
GODRIVER-1827 Implement and Test Connection Pool Paused State
-
- Closed
-