0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-20 17:01:55 +01:00

ircd::net: Wait for pending resolver tags to complete on shutdown.

This commit is contained in:
Jason Volk 2018-09-17 21:31:23 -07:00
parent 176e70d2c7
commit 8d435305d0

View file

@ -3286,6 +3286,17 @@ ircd::net::dns::resolver::~resolver()
noexcept noexcept
{ {
ns.close(); ns.close();
while(!tags.empty())
{
log::warning
{
log, "Waiting for %zu unfinished DNS resolutions",
tags.size()
};
ctx::sleep(3);
}
sendq_context.interrupt(); sendq_context.interrupt();
timeout_context.interrupt(); timeout_context.interrupt();
assert(tags.empty()); assert(tags.empty());
@ -3388,7 +3399,7 @@ ircd::net::dns::resolver::check_timeout(const uint16_t &id,
}; };
tag.last = steady_point{}; tag.last = steady_point{};
if(tag.tries < size_t(retry_max)) if(ns.is_open() && tag.tries < size_t(retry_max))
{ {
submit(tag); submit(tag);
return false; return false;