[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).
2. A "shutdown error" on any server, or a "not master" error on <=4.0 server.
3. Any network error during monitoring.

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 CDRIVER-3625 may change this). There is a timestamp field on a topology scanner node. It is set to the current time every time the scanner node re-establishes connection.


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