I have a production code that heavily used asyncio.semaphore module which is suspected to have deadlock problem.
I already found some solution of how to attach to running python code with unix signal, debug with ipdb.set_trace() and list all tasks on event loop with asyncio.Task.all_tasks(). Can I further inspect into the stack frame of each task or viewing each line of coroutine which is currently pending by futures on ipdb?
As OP observes, further inspections may be obtained with
[*map(asyncio.Task.print_stack, asyncio.Task.all_tasks())]
(OP is certainly free to self-answer.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With