-
Type: Task
-
Resolution: Works as Designed
-
Priority: Critical - P2
-
None
-
Affects Version/s: 2.2.4
-
Component/s: Connectivity
-
(copied to CRM)
Hello, I have a .net core web application that gets some information from MongoDB replica set but from time to time I'm getting a timeout errors.
I'm using a repository pattern and in mine IoC container (autofac) MongoDB repository is registered with InstancePerLifetimeScope.
Connection String: mongodb://<first server name>,<second server name>,<third server name>/<database name>?replicaSet=rs0&connectTimeoutMS=30000
MongoDB Driver version is 2.2.4
MongoDB version is 3.0.7
Error message is:
Exception: System.TimeoutException Source: MongoDB.Driver.Core Message: A timeout occured after 30000ms selecting a server using CompositeServerSelector{
Selectors = ReadPreferenceServerSelector{ ReadPreference =
}, LatencyLimitingServerSelector
{ AllowedLatencyRange = 00:00:00.0150000 } }.
Client view of cluster state is { ClusterId : "2", ConnectionMode : "ReplicaSet", Type : "ReplicaSet", State : "Disconnected", Servers : [
{ ServerId: "
", EndPoint: "Unspecified/<first server name>", State: "Disconnected", Type: "Unknown" },
{ ServerId: "
", EndPoint: "Unspecified/<second server name>", State: "Disconnected", Type: "Unknown" },
{ ServerId: "
", EndPoint: "Unspecified/<third server name>", State: "Disconnected", Type: "Unknown" }] }.
Stack Trace Message:
at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)
at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)
at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Bindings.ReadPreferenceBinding.GetReadChannelSource(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.FindOperation`1.Execute(IReadBinding binding, CancellationToken cancellationToken)
at MongoDB.Driver.OperationExecutor.ExecuteReadOperation[TResult](IReadBinding binding, IReadOperation`1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IReadOperation`1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IReadOperation`1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.FindSync[TProjection](FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken)
at MongoDB.Driver.FindFluent`2.ToCursor(CancellationToken cancellationToken)
at MongoDB.Driver.IAsyncCursorSourceExtensions.FirstOrDefault[TDocument](IAsyncCursorSource`1 source, CancellationToken cancellationToken)
at MongoDB.Driver.IFindFluentExtensions.FirstOrDefault[TDocument,TProjection](IFindFluent`2 find, CancellationToken cancellationToken)
To trace these errors I created a tool that periodically connects to MongoDB and logs connection state. According to these logs mongo was accessible at that point of time when one of these timeouts occurred so I'm pretty sure that it's not a network issue.
- is duplicated by
-
CSHARP-2540 A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }
- Closed
- related to
-
CSHARP-2490 Reimplement SDAM to follow the spec more closely
- Development Complete