[CDRIVER-3644] Improve behavior of clearing connections Created: 02/May/20 Updated: 23/Mar/23 |
|
| Status: | Backlog |
| Project: | C Driver |
| Component/s: | network |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | 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 |
|
In SDAM, connection pools are cleared in these situations: 1. A network error on an app socket (any error during handshake, or a non-timeout error after). libmongoc does not have a connection pool, but instead a client pool. It partially implements some of this behavior for the connections it has to a server, but it needs improvement. (1) is partially implemented in mongoc-cluster.c by calls to mongoc_cluster_disconnect_node. But this only disconnects the current client's connection to the server. It does not disconnect other clients. And it does not disconnect the topology scanner (which may be due to the fact that the topology scanner is not thread safe). (2) similarly only applies to the client receiving the error. It does not close connections on other clients in the pool or the topology scanner. (3) is currently implemented (though |