-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix/726 738 dns cache refresh impr #1637
Conversation
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 ran a few tests on this branch and went over the code briefly, and it doesn't seem to be using the cache at all now(?). I don't see where you're populating Dialer.dnsCache
, so all my requests hit the DNS server regardless of the config.
I'll review this again once it's more fleshed out. For now only the dnsmessage
comment seems like a blocker.
v4: &dnsCache{ | ||
RWMutex: sync.RWMutex{}, | ||
cache: make(map[string]*cacheRecord), | ||
}, | ||
v6: &dnsCache{ | ||
RWMutex: sync.RWMutex{}, | ||
cache: make(map[string]*cacheRecord), | ||
}, |
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.
Why are separate caches needed for v4 and v6?
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.
We get separate requests for them so it was easier to have them separate
) | ||
|
||
// Message is a DNS message. | ||
type Message struct { |
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 don't think we should be using this message implementation. It seems to be an old copy of the one currently used in stdlib, and we should rely on that one instead. This probably means that we can't use benburkert/dns
as a library and will need to re-implement what we need ourselves.
Closing as discussed, see #1751. |
Things that need to be done:
Resolver