-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 1.9.1
-
Component/s: Connectivity
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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.