Hi,
I have been trying to make unhandled exceptions reliably crash the event loop (eg replicated behaviour of
boost::asio, for those familiar with that C++ library). I'm aiming to have any exception bubble up from
run_forever or
run_until_complete style functions. I had thought I had a perfectly acceptable solution and then hit a strange case that threw my understanding of the way the loop worked.
In '
test_b' below, the only difference is we keep a reference to the created task. This test hangs - the exception is raised, but the custom exception handler is never called.
I'd be very interested to understand exactly why this happens. I'd also appreciate any feedback on the best way to reliably crash the event loop on unhandled exceptions (my next attempt will be to replace
and see what happens).