[CDRIVER-4251] mongoc_client_new_from_uri may leak topology Created: 23/Dec/21 Updated: 28/Oct/23 Resolved: 04/Jan/22 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.21.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeremy Mikola | Assignee: | Jeremy Mikola |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
In mongoc_client_new, the topology is freed before returning NULL. The same does not happen in mongoc_client_new_from_uri. This can be addressed alongside |
| Comments |
| Comment by Githook User [ 04/Jan/22 ] |
|
Author: {'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}Message: Introduces new mongoc_client_new_from_uri_with_error and mongoc_client_pool_new_with_error methods. Also addresses topology leak in mongoc_client_new_from_uri (
This no longer requires constructing a client and expecting an error through server selection.
Moving the check up from _mongoc_client_new_from_topology makes mongoc_client_new_from_uri_with_error consistent with mongoc_client_pool_new_with_error. Additionally, we add log message assertions to corresponding tests.
These tests were previously introduced in
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com> |
| Comment by Jeremy Mikola [ 23/Dec/21 ] |