-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not update lighthouse ips if dns lookup failed #1184
Conversation
Thanks for the contribution! Before we can merge this, we need @yylt to sign the Salesforce Inc. Contributor License Agreement. |
Can you please describe the purpose of this change? In #1183 you stated it resolved some issues. Can you describe the issues this change resolved? My understanding of the code here is that if DNS resolution fails, it may be seen as a "different" list of IPs than resolved previously. However, the results of this function are prepended to the overall cache here: Lines 565 to 569 in 16eaae3
In other words, I don't think a failure to resolve will end up removing any previously successfully resolved queries. Given that that is the case, I'm not sure I understand what this PR is attempting to fix. |
netipAddrs := map[netip.AddrPort]struct{}{} | ||
for _, hostPort := range r.hostnames { | ||
timeoutCtx, timeoutCancel := context.WithTimeout(ctx, r.lookupTimeout) | ||
addrs, err := net.DefaultResolver.LookupNetIP(timeoutCtx, r.network, hostPort.name) | ||
timeoutCancel() | ||
if err != nil { | ||
l.WithFields(logrus.Fields{"hostname": hostPort.name, "network": r.network}).WithError(err).Error("DNS resolution failed for static_map host") | ||
lookupSuccess = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for correctness, the default would need to be false and toggle this to true
when err == nil. This is because if we try to resolve multiple hostnames for a given Nebula IP, and one fails and another succeeds, we'd like to use the results from the successful query.
I apologize, the PR and issue mentioned different situation, both related to DDNS, so they were linked together. Here is log section and why submit this change.
Based on the above, it appears that DNS queries are fluctuating—sometimes there is an ip, and other times times out. This might be related to UDP traffic in the environment. However, since this is happening in virtual machine, I'm not sure how to investigate further, so handle the error if dns query failed. |
@yylt Thanks for explaining. Indeed it looks like half of the DNS queries in the log are failing. That being said, the failing lookups should not be overriding the successful lookups in the cache Nebula uses to find hosts (which is a separate list from the one referenced in One way to verify this is to enable the debug SSH server and then issue the |
Since the Additionally, the DDNS changes approximately once a week, requiring SSH to be opened and checked after address change. It is unlikely to be feasible in the short term. |
@yylt Understood that you're unable to test currently, but this PR doesn't appear to solve any issues and the code as written creates undesirable behaviors (such as a single DNS lookup failure causing successful queries to be discarded.) Thanks for the contribution, but I'm going to close the PR. |
No description provided.