Connection timeout to MongoDB 3.2

I am using the .NET Driver version 2.2.4 (an application using .NET 4.5) to connect to MongoDB version 3.2, and I get some timeout exceptions.

Detailed scenario: we have a ReplicaSet with 2 servers, and on one of the servers there is also an arbiter working on port 27018.

The application that connects runs on two servers (A and B) with Windows Server 2008 R2.

On server A, all connections and requests work fine, but on server B, the first connection throws a timeout exception followed by an error message:

A timeout occurred after 30,000 ms, selecting a server using CompositeServerSelector {Selectors = ReadPreferenceServerSelector {
ReadPreference = {Mode = Primary, TagSets = []}},
LatencyLimitingServerSelector {AllowedLatencyRange = 00:00:01}}.
The client view of the cluster state is {ClusterId: "5", ConnectionMode:
"ReplicaSet", Type: "ReplicaSet", Status: "Disabled", Servers:
[{ServerId: "{ClusterId: 5, EndPoint:
" Unspecified / serverA.domain : 27017 "}", EndPoint:
"Unspecified / serverA.domain: 27017", State: "Disabled", Type:
"Unknown"}, {ServerId: "{ClusterId: 5, EndPoint:
" Unspecified / serverB.domain: 27017 "}", EndPoint:
"Unspecified / serverB.domain: 27017", Status: "Disabled", Type:
"Unknown"}]}.

In the second attempt, the connection works and continues to work throughout the life cycle of the application.

Does anyone know what happens with the initial connection?

+4
source share

Source: https://habr.com/ru/post/1652631/


All Articles