mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #12296 from ClickHouse/fix_rare_hanging_in_dnsresolver
Fix rare hanging in DNSResolver
This commit is contained in:
commit
1062270580
@ -269,6 +269,8 @@ bool DNSResolver::updateCache()
|
||||
LOG_DEBUG(log, "Updating DNS cache");
|
||||
|
||||
{
|
||||
String updated_host_name = Poco::Net::DNS::hostName();
|
||||
|
||||
std::lock_guard lock(impl->drop_mutex);
|
||||
|
||||
for (const auto & host : impl->new_hosts)
|
||||
@ -279,7 +281,7 @@ bool DNSResolver::updateCache()
|
||||
impl->known_addresses.insert(address);
|
||||
impl->new_addresses.clear();
|
||||
|
||||
impl->host_name.emplace(Poco::Net::DNS::hostName());
|
||||
impl->host_name.emplace(updated_host_name);
|
||||
}
|
||||
|
||||
/// FIXME Updating may take a long time becouse we cannot manage timeouts of getaddrinfo(...) and getnameinfo(...).
|
||||
|
Loading…
Reference in New Issue
Block a user