0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::client: Record all stuck clients in dwarning on shutdown.

ircd::server: Record all stuck peers in dwarning on shutdown.
This commit is contained in:
Jason Volk 2019-07-25 15:11:57 -07:00
parent 494288ea77
commit 58dd728f49
2 changed files with 35 additions and 7 deletions

View file

@ -169,13 +169,27 @@ ircd::client::wait_all()
pool.queued()
};
while(!client::map.empty())
if(!dock.wait_for(seconds(2)) && !client::map.empty())
log::warning
static const auto is_empty
{
[] { return client::map.empty(); }
};
while(!dock.wait_for(seconds(3), is_empty))
{
for(const auto &[remote, client] : client::map)
log::dwarning
{
log, "Waiting for %zu clients to close...", client::map.size()
log, "Waiting for client %s",
client->loghead(),
};
log::warning
{
log, "Waiting for %zu clients to close...",
client::map.size(),
};
}
log::debug
{
log, "Joining %zu active of %zu client request contexts; %zu pending; %zu queued",

View file

@ -65,10 +65,24 @@ noexcept
void
ircd::server::wait_all()
{
while(peer_unfinished())
static const auto finished
{
if(dock.wait_for(seconds(4)))
continue;
[] { return !peer_unfinished(); }
};
while(!dock.wait_for(seconds(4), finished))
{
for(const auto &[name, peer] : peers)
log::dwarning
{
log, "Waiting for peer %s tags:%zu links:%zu err:%b op[r:%b f:%b] %s",
name,
peer->tag_count(),
peer->link_count(),
peer->err_has(),
peer->op_resolve,
peer->op_fini,
};
log::warning
{