[CSHARP-2957] Connection error due to DNS failed lookup Created: 07/Feb/20  Updated: 26/Mar/20  Resolved: 26/Mar/20

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

Type: Bug Priority: Major - P3
Reporter: Francois Beauchemin Assignee: Dmitry Lukyanov (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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 ? 



 Comments   
Comment by Dmitry Lukyanov (Inactive) [ 26/Mar/20 ]

Hello francois.beauchemin@vooban.com, the scope of this ticket will be implemented in CSHARP-2968

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