[Async-sig] set_blocking_signal_threshold equivalent for asyncio?

Yusuke Tsutsumi yusuke at tsutsumi.io
Fri Feb 8 17:09:53 EST 2019


Hi,

In tornado, there's a really nice feature called
set_blocking_signal_threshold, which sets a signal that fires if a
coroutine has been running for too long without returning control back to
the main loop:

https://www.tornadoweb.org/en/stable/ioloop.html?highlight=signal#tornado.ioloop.IOLoop.set_blocking_signal_threshold

In tornado this will then log the traceback of the coroutine in question.
This has been a very valuable tool when a developer accidentally introduces
code that blocks the event loop for way too long of a time.

Is there an equivalent in asyncio? I have a sketch in my head of how to
implement that, but wanted to see if it existed somewhere first.

Thanks!
-Yusuke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/async-sig/attachments/20190208/fe88e386/attachment.html>


More information about the Async-sig mailing list