[CSHARP-2540] A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } } Created: 07/Mar/19  Updated: 08/Mar/23  Resolved: 11/Mar/19

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

Type: Bug Priority: Critical - P2
Reporter: santhosh K Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Azure


Issue Links:
Duplicate
duplicates CSHARP-1895 System.TimeoutException: A timeout oc... Closed

 Description   

Hi, 

I have a docker containerized .Net core web API application running in AKS which connects to Azure cosmos db using Mondb .net driver to perform CRUD operations.

I don't face any issues running locally, but in the AKS cluster MongoDB client throws System.TimeoutException frequently and it gets resolved only after restarting the Pod.

MongoDb .Net driver Version: 2.7.3(latest)

MongoClient is registered as a singleton service and enabled Ssl as well.

Please find the exception below and let me know how to resolve this as early as possible. Its creating issues and am unable to predict the root cause as it occurs only in the azure cluster.

Suggest any workarounds if possible.

Thanks in advance!

"ClassName": "System.TimeoutException",
 "Message": "A timeout occured after 30000ms selecting a server using CompositeServerSelector\{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is \{ ClusterId : \"1\", ConnectionMode : \"ReplicaSet\", Type : \"ReplicaSet\", State : \"Disconnected\", Servers : [{ ServerId: \"{ ClusterId : 1, EndPoint : \"Unspecified/cdb-ms-prod-eastus1-fd18.documents.azure.com:10255\" }\", EndPoint: \"Unspecified/cdb-ms-prod-eastus1-fd18.documents.azure.com:10255\", State: \"Disconnected\", Type: \"Unknown\" }] }.",
 "Data": null,
 "InnerException": null,
 "HelpURL": null,
 "StackTraceString": " at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)\n at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)\n at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedAsync(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)\n at MongoDB.Driver.Core.Clusters.Cluster.SelectServerAsync(IServerSelector selector, CancellationToken cancellationToken)\n at MongoDB.Driver.MongoClient.AreSessionsSupportedAfterSeverSelctionAsync(CancellationToken cancellationToken)\n at MongoDB.Driver.MongoClient.AreSessionsSupportedAsync(CancellationToken cancellationToken)\n at MongoDB.Driver.MongoClient.StartImplicitSessionAsync(CancellationToken cancellationToken)\n at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync[TResult](Func`2 funcAsync, CancellationToken cancellationToken)



 Comments   
Comment by James Kovacs [ 08/Mar/23 ]

For more information, see Why Does the Driver Throw a Timeout During Server Selection? in the MongoDB .NET/C# Driver FAQ.

Comment by Ian Whalen (Inactive) [ 11/Mar/19 ]

dupe of CSHARP-1895.

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