0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

modules/federation/sender: Don't propagate exceptions outside of the hook handler.

This commit is contained in:
Jason Volk 2019-07-13 23:07:29 -07:00
parent 56ab4f397c
commit c1b3dc1142
2 changed files with 27 additions and 0 deletions

View file

@ -755,6 +755,7 @@ ircd::m::sync::longpoll::notified
void
ircd::m::sync::longpoll::handle_notify(const m::event &event,
m::vm::eval &eval)
try
{
assert(eval.opts);
if(!eval.opts->notify_clients)
@ -762,6 +763,19 @@ ircd::m::sync::longpoll::handle_notify(const m::event &event,
dock.notify_all();
}
catch(const ctx::interrupted &)
{
throw;
}
catch(const std::exception &e)
{
log::critical
{
log, "request %s longpoll notify :%s",
loghead(eval),
e.what(),
};
}
/// Longpolling blocks the client's request until a relevant event is processed
/// by the m::vm. If no event is processed by a timeout this returns false.

View file

@ -71,6 +71,7 @@ notified
void
handle_notify(const m::event &event,
m::vm::eval &eval)
try
{
if(!my(event))
return;
@ -89,6 +90,18 @@ handle_notify(const m::event &event,
notified_queue.emplace_back(json::strung{event}, event_id);
notified_dock.notify_all();
}
catch(const ctx::interrupted &)
{
throw;
}
catch(const std::exception &e)
{
log::critical
{
m::log, "Federation sender notify handler :%s",
e.what()
};
}
void
__attribute__((noreturn))