[CDRIVER-4254] Prohibit construction of invalid topology in mongoc_topology_new Created: 29/Dec/21  Updated: 31/Mar/22

Status: Backlog
Project: C Driver
Component/s: libmongoc, SDAM
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-3723 Validate URI options on client/client... Closed
Duplicate
duplicates CDRIVER-3723 Validate URI options on client/client... Closed
Related
is related to CDRIVER-4184 Assert in invalid topology in load ba... Closed

 Description   

After CDRIVER-3723, it will no longer be possible to construct a client or pool with an invalid topology (i.e. SRV lookup or URI finalization failed). Previously, clients and pools could be created with an invalid topology and errors would not be relayed until the first instance of server selection.

Consider refactoring mongoc_topology_new to take an optional bson_error_t and return NULL if the topology would be considered invalid.

Once it is no longer possible to construct an invalid topology, checks for topology->valid (e.g. 2d94467 from CDRIVER-4184) can also be removed.


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