0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

ircd: Remove / update various ctx::interrupted catch blocks for ctx::terminated.

This commit is contained in:
Jason Volk 2018-05-06 01:15:26 -07:00
parent 48055cb276
commit 003ecf6357
10 changed files with 29 additions and 87 deletions

View file

@ -261,6 +261,11 @@ catch(const ctx::interrupted &e)
cancel();
throw;
}
catch(const ctx::terminated &)
{
cancel();
throw;
}
///////////////////////////////////////////////////////////////////////////////
//

View file

@ -783,10 +783,6 @@ try
return ret;
}
catch(const ctx::interrupted &e)
{
throw;
}
catch(const boost::system::system_error &e)
{
if(e.code().value() != boost::system::errc::operation_canceled)

View file

@ -70,12 +70,19 @@ noexcept try
if(likely(bool(func)))
func();
}
catch(const ircd::ctx::interrupted &)
{
return;
}
catch(const ircd::ctx::terminated &)
{
return;
}
catch(const std::exception &e)
{
log::critical
{
"ctx(%p '%s' #%u): unhandled: %s",
current,
"ctx('%s' #%u): unhandled: %s",
name,
id,
e.what()
@ -88,10 +95,6 @@ catch(const std::exception &e)
// handling the exception here with a log message and calling it a day.
return;
}
catch(const terminated &)
{
return;
}
/// Direct context switch to this context.
///
@ -913,12 +916,17 @@ noexcept try
}
catch(const interrupted &e)
{
/*
log::debug
// log::debug
// {
// "pool(%p) ctx(%p): %s", this, &cur(), e.what()
// };
}
catch(const terminated &e)
{
"pool(%p) ctx(%p): %s", this, &cur(), e.what()
};
*/
// log::debug
// {
// "pool(%p) ctx(%p): %s", this, &cur(), e.what()
// };
}
void

View file

@ -235,11 +235,11 @@ noexcept try
// executes backwards from this point and shuts down IRCd.
ctx::wait();
}
catch(const ctx::interrupted &e)
catch(const ctx::terminated &)
{
log::warning
{
"IRCd main interrupted..."
"IRCd main terminated..."
};
}
catch(const std::exception &e)
@ -249,15 +249,6 @@ catch(const std::exception &e)
"IRCd main exited: %s", e.what()
};
}
catch(const ctx::terminated &)
{
log::warning
{
"IRCd main terminated..."
};
throw;
}
void
ircd::at_main_exit()

View file

@ -2546,10 +2546,6 @@ try
{
hook.function(event);
}
catch(const ctx::interrupted &e)
{
throw;
}
catch(const std::exception &e)
{
log::critical

View file

@ -2849,7 +2849,6 @@ noexcept
void
ircd::net::dns::resolver::sendq_worker()
try
{
while(1)
{
@ -2869,10 +2868,6 @@ try
sendq.pop_front();
}
}
catch(const ctx::interrupted &)
{
return;
}
void
ircd::net::dns::resolver::flush(const queued &next)
@ -2900,7 +2895,6 @@ catch(const std::out_of_range &e)
void
ircd::net::dns::resolver::timeout_worker()
try
{
while(1)
{
@ -2913,10 +2907,6 @@ try
check_timeouts(milliseconds(timeout));
}
}
catch(const ctx::interrupted &)
{
return;
}
void
ircd::net::dns::resolver::check_timeouts(const milliseconds &timeout)

View file

@ -327,10 +327,6 @@ try
{
m::join(room, user);
}
catch(const ctx::interrupted &e)
{
throw;
}
catch(const std::exception &e)
{
log::error

View file

@ -185,7 +185,6 @@ calc_timesout(const resource::request &request)
void
timeout_worker()
try
{
while(1)
{
@ -198,13 +197,6 @@ try
ctx::sleep(seconds(5));
}
}
catch(const ctx::interrupted &)
{
log::debug
{
"Typing timeout worker interrupted"
};
}
void
timeout_check()

View file

@ -44,8 +44,8 @@ IRCD_MODULE
"federation sender",
nullptr, []
{
sender.interrupt();
receiver.interrupt();
sender.terminate();
receiver.terminate();
sender.join();
receiver.join();
}
@ -53,7 +53,6 @@ IRCD_MODULE
void
send_worker()
try
{
// In order to synchronize with the vm core, this context has to
// maintain this shared_lock at all times. If this is unlocked we
@ -74,10 +73,6 @@ try
if(my(event))
send(event);
}
catch(const ircd::ctx::interrupted &e)
{
throw;
}
catch(const std::exception &e)
{
log::error
@ -86,13 +81,6 @@ try
};
}
}
catch(const ircd::ctx::interrupted &e)
{
log::debug
{
"Sender worker interrupted..."
};
}
void
send(const m::event &event)
@ -221,7 +209,6 @@ catch(const std::exception &e)
void
recv_worker()
try
{
while(1)
{
@ -234,13 +221,6 @@ try
recv_timeouts();
}
}
catch(const ircd::ctx::interrupted &e)
{
log::debug
{
"Receive worker interrupted..."
};
}
void
recv()
@ -288,10 +268,6 @@ try
node.flush();
}
catch(const ctx::interrupted &e)
{
throw;
}
catch(const std::exception &e)
{
ircd::assertion(e);
@ -345,10 +321,6 @@ try
return true;
}
catch(const ctx::interrupted &e)
{
throw;
}
catch(const http::error &e)
{
log::derror

View file

@ -65,10 +65,6 @@ try
for(const json::object &presence : push)
handle_edu_m_presence_(event, presence);
}
catch(const ctx::interrupted &)
{
throw;
}
catch(const std::exception &e)
{
log::derror