I'm using .NET Driver version 2.2.4 (application using .NET 4.5) to connect to MongoDB version 3.2 and I'm receiving some timeout exceptions.
Scenario detail: We have a ReplicaSet with 2 servers, and one of the servers also has an arbiter running at port 27018.
The application that is connecting, runs in two servers (A and B) with Windows Server 2008 R2.
In server A all connections and requests work perfectly, but in server B, the first connection throws a timeout exception with the follow error message:
A timeout occured after 30000ms selecting a server using
CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{
ReadPreference = { Mode = Primary, TagSets = [] } },
LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:01 } }.
Client view of cluster state is { ClusterId : "5", ConnectionMode :
"ReplicaSet", Type : "ReplicaSet", State : "Disconnected", Servers :
[{ ServerId: "{ ClusterId : 5, EndPoint :
"Unspecified/serverA.domain:27017" }", EndPoint:
"Unspecified/serverA.domain:27017", State: "Disconnected", Type:
"Unknown" }, { ServerId: "{ ClusterId : 5, EndPoint :
"Unspecified/serverB.domain:27017" }", EndPoint:
"Unspecified/serverB.domain:27017", State: "Disconnected", Type:
"Unknown" }] }.
On a second try, the connection works and keeps working throughout the life-cycle of the application.
Does someone knows what is going wrong with the initial connection?