[CSHARP-1008] Minimize the number of exceptions thrown after a replica set failover Created: 26/Jun/14  Updated: 01/Apr/19  Resolved: 01/Apr/19

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 1.9.1
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Robert Stam Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As currently implemented, the driver throws a large number of exceptions when a replica set elects a new primary.

While theoretically this should make no difference (an application can handle retrying 100 exceptions as easily as it can handle one), it is a perception problem.

There should be a way that when the first exception occurs we can use that information to help prevent further exceptions.

An example of the kind of thing we could do is that when we get the first exception indicating a socket has been closed by the remote end (recall that the primary closes all of its sockets when it steps down), we could mark the remaining connections in the connection pool as suspect. For each suspect connection, we could issue a ping command to verify that the connection is still operational before using it, and replacing it with a new one if it is not.



 Comments   
Comment by Jeffrey Yemin [ 01/Apr/19 ]

The SDAM spec now requires this behavior, and the driver implements the spec. So closing as Done.

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