Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2665

System.TimeoutException:“A timeout occured after 30000ms selecting a server using CompositeServerSelector

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.8.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      asp net core 2.2 vs 2017 windows 10

        I was Running a mongodb cluster with 1 primary and 2 secondry , and the auth was turned off .

        If i use this connection "mongodb://192.168.0.243:27017" ,it works fine , but if i use this connection "mongodb://192.168.0.243:27017,192.168.0.242:27017,192.168.0.246:27017" ,it throw a timeout exception .
      Exception details :
      system.TimeoutException
      HResult=0x80131505
      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 : "10.36.0.4:27017" }

      ", EndPoint: "10.36.0.4:27017", State: "Disconnected", Type: "Unknown", LastUpdateTimestamp: "2019-07-11T10:05:57.1551274Z" }, { ServerId: "

      { ClusterId : 1, EndPoint : "10.39.0.5:27017" }

      ", EndPoint: "10.39.0.5:27017", State: "Disconnected", Type: "Unknown", LastUpdateTimestamp: "2019-07-11T10:05:57.1550598Z" }, { ServerId: "

      { ClusterId : 1, EndPoint : "10.42.0.2:27017" }

      ", EndPoint: "10.42.0.2:27017", State: "Disconnected", Type: "Unknown", LastUpdateTimestamp: "2019-07-11T10:05:57.1551144Z" }] }.
      Source=MongoDB.Driver.Core
      StackTrace:
      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.MongoClient.AreSessionsSupportedAfterServerSelection(CancellationToken cancellationToken)
      at MongoDB.Driver.MongoClient.AreSessionsSupported(CancellationToken cancellationToken)
      at MongoDB.Driver.OperationExecutor.StartImplicitSession(CancellationToken cancellationToken)
      at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession[TResult](Func`2 func, CancellationToken cancellationToken)
      at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)
      at MongoDB.Driver.MongoCollectionBase`1.<>c_DisplayClass64_0.<InsertOne>b_0(IEnumerable`1 requests, BulkWriteOptions bulkWriteOptions)
      at MongoDB.Driver.MongoCollectionBase`1.InsertOne(TDocument document, InsertOneOptions options, Action`2 bulkWrite)
      at MongoDB.Driver.MongoCollectionBase`1.InsertOne(TDocument document, InsertOneOptions options, CancellationToken cancellationToken)
      at Comteck_k8s_ha_test_web.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in C:\Users\Admin\source\repos\test\Startup.cs:line 75
       

            Assignee:
            scott.lhommedieu@mongodb.com Scott L'Hommedieu (Inactive)
            Reporter:
            377973147@qq.com ding songjie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: