mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
use dnscache resolver for resolving command line endpoints (#14135)
this helps in caching the resolved values early on, avoids causing further resolution for individual nodes when object layer comes online. this can speed up our startup time during, upgrades etc by an order of magnitude. additional changes in connectLoadInitFormats() and parallelize all calls that might be potentially blocking.
This commit is contained in:
@@ -102,15 +102,14 @@ func mustGetLocalIP6() (ipList set.StringSet) {
|
||||
|
||||
// getHostIP returns IP address of given host.
|
||||
func getHostIP(host string) (ipList set.StringSet, err error) {
|
||||
var ips []net.IP
|
||||
|
||||
if ips, err = net.LookupIP(host); err != nil {
|
||||
addrs, err := globalDNSCache.LookupHost(GlobalContext, host)
|
||||
if err != nil {
|
||||
return ipList, err
|
||||
}
|
||||
|
||||
ipList = set.NewStringSet()
|
||||
for _, ip := range ips {
|
||||
ipList.Add(ip.String())
|
||||
for _, addr := range addrs {
|
||||
ipList.Add(addr)
|
||||
}
|
||||
|
||||
return ipList, err
|
||||
|
||||
Reference in New Issue
Block a user