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

Connection error due to DNS failed lookup

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Connectivity
    • None

    Description

      We're using MongoD.Driver to connect to an Atlas cluster from a AKS (azure kubernetes service)  cluster. 

       

      On a newly created cluster, we are having troubles connecting  with this error : 

      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 : [], DnsMonitorException : "DnsClient.DnsResponseException: Unhandled exception ---> System.InvalidOperationException: Record reader index out of sync.\n at DnsClient.DnsRecordFactory.GetRecord(ResourceRecordInfo info)\n at DnsClient.DnsMessageHandler.GetResponseMessage(ArraySegment1 responseData)\n at DnsClient.DnsUdpMessageHandler.Query(IPEndPoint server, DnsRequestMessage request, TimeSpan timeout)\n at DnsClient.LookupClient.ResolveQuery(IReadOnlyCollection1 servers, DnsMessageHandler handler, DnsRequestMessage request, Boolean useCache, LookupClientAudit continueAudit)\n --- End of inner exception stack trace ---\n at DnsClient.LookupClient.ResolveQuery(IReadOnlyCollection1 servers, DnsMessageHandler handler, DnsRequestMessage request, Boolean useCache, LookupClientAudit continueAudit)\n at DnsClient.LookupClient.QueryInternal(IReadOnlyCollection1 servers, DnsQuestion question, Boolean useCache)\n at DnsClient.LookupClient.Query(String query, QueryType queryType, QueryClass queryClass)\n at MongoDB.Driver.Core.Misc.DnsClientWrapper.ResolveSrvRecords(String service, CancellationToken cancellationToken)\n at MongoDB.Driver.Core.Clusters.DnsMonitor.Monitor()"
      

      I've made a small test program that use direclty DNSClient and it seems the SRV lookup fails from time to time with the "Record reader index out of sync." 

      Is there any way to have the mongodb driver retry the dns lookup when it fails ? 

      Attachments

        Activity

          People

            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            francois.beauchemin@vooban.com Francois Beauchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: