[CDRIVER-3492] mongoc_client_reset should do nothing if passed a multi-threaded client Created: 17/Jan/20 Updated: 31/Mar/22 |
|
| Status: | Backlog |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently mongoc_client_reset clears the session pool on the client's topology by calling _mongoc_topology_clear_session_pool. This is fine for a single-threaded client, but not ok for a client derived from a mongoc_client_pool_t since the topology object is shared among all pooled clients, and no lock is taken. We decided not to implement a mongoc_client_pool_reset in mongoc_client_reset should probably warn and return without doing anything if given a multi-threaded client. Let's also document in mongoc_client_reset that this only applies to single threaded clients. |