-
Notifications
You must be signed in to change notification settings - Fork 671
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
feat: s3/transfermanager (v2): round-robin DNS and multi-NIC #2975
feat: s3/transfermanager (v2): round-robin DNS and multi-NIC #2975
Conversation
if ok { | ||
return addr, nil | ||
} | ||
return r.lookupHost(ctx, host) |
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.
So when we have a cache miss we'll refresh the whole cache? is this what we want?
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.
Not the whole cache? We just re-query for that one host, or am I missing something?
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.
cache is hostname -> []<ip address>
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.
You're right, my thinking was that we were storing things like
hostname -> {
ip1/expiry1
ip2/expiry2
ip3/expiry3
}
But we're storing all results of the lookup with the same expiry (since we don't get TTL), so the entries are
hostname -> {
ip1/expiry1
ip2/expiry1
ip3/expiry1
}
Then it doesn't really matter if one expires since all entries from the lookup will expire at the same time. And anyway, anytime we do a lookup for the same hostname, we replace existing values so they effectively always have the same expiry
Add two functional options to configure http.Transport to do the following:
DialContext
hook with one that cycles between supplied local addresses (NICs).