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:
parent
176e70d2c7
commit
8d435305d0
1 changed files with 12 additions and 1 deletions
13
ircd/net.cc
13
ircd/net.cc
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue