[Enhancement](heartbeat) make heartbeat ok when config repeated host-ip pairs (#21228)
This commit is contained in:
@ -96,7 +96,15 @@ Status hostname_to_ip_addrs(const std::string& name, std::vector<std::string>* a
|
||||
return Status::InternalError("Could not convert IPv4 address for: {}", name);
|
||||
}
|
||||
|
||||
addresses->push_back(std::string(addr_buf));
|
||||
// add address if not exists
|
||||
std::string address = std::string(addr_buf);
|
||||
if (std::find(addresses->begin(), addresses->end(), address) != addresses->end()) {
|
||||
LOG(WARNING) << "Repeated ip addresses has been found for host: " << name
|
||||
<< ", ip address:" << address
|
||||
<< ", please check your network configuration";
|
||||
} else {
|
||||
addresses->push_back(address);
|
||||
}
|
||||
it = it->ai_next;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user