[CSHARP-1709] Application gets stuck with no mongo servers connecting until app pool is reset. Created: 13/Jul/16  Updated: 13/Jul/20  Resolved: 13/Jul/20

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

Type: Bug Priority: Major - P3
Reporter: aaron nighelli Assignee: Unassigned
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

iis 8, .net 4.5



 Description   

a webserver will sometimes get stuck with the following error until the app pool is reset, connectivity to the mongo servers appear fine. what is the problem ? it sounds like the heartbeat stops working.

w3wp.exe Error: 0 : System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector

{ AllowedLatencyRange = 00:00:00.0150000 }

}. Client view of cluster state is { ClusterId : "2", ConnectionMode : "ReplicaSet", Type : "ReplicaSet", State : "Disconnected", Servers : [{ ServerId: "

{ ClusterId : 2, EndPoint : "Unspecified/paspirehdb01:27017" }

", EndPoint: "Unspecified/paspirehdb01:27017", State: "Disconnected", Type: "Unknown" }, { ServerId: "

{ ClusterId : 2, EndPoint : "Unspecified/paspirehdb02:27017" }

", EndPoint: "Unspecified/paspirehdb02:27017", State: "Disconnected", Type: "Unknown" }] }.
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.WritableServerBinding.GetWriteChannelSource(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.CreateIndexesOperation.Execute(IWriteBinding binding, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.ExecuteWriteOperation[TResult](IWriteOperation`1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.MongoIndexManager.CreateMany(IEnumerable`1 models, CancellationToken cancellationToken)
at MongoDB.Driver.MongoIndexManagerBase`1.CreateOne(IndexKeysDefinition`1 keys, CreateIndexOptions options, CancellationToken cancellationToken)



 Comments   
Comment by Jeffrey Yemin [ 13/Jul/20 ]

We can re-open this if anyone finds a reproducer on the current version of the driver.

Comment by aaron nighelli [ 15/Jul/16 ]

all signs point to nothing happening out of the ordinary from the server perspective.
the farm consists of 5 servers and only this one had this error happen.
my gut tells me it is something to do with the Timer for the heartbeat. like you I didn't see the exception and I dug through the code and the only way you wouldn't see the exception is if the heartbeatasync never gets called.

Comment by Craig Wilson [ 14/Jul/16 ]

We've seen this type of stuff before, but it's incredibly difficult to diagnose. What's missing up there is a heartbeat exception. I"m not sure why it isn't showing up. You can try enabling network tracing, particularly System.Net.Sockets to see what;s going on there.

Was there a network blip at the point it failed? Did a primary failover? Did an election happen?

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