trio-asyncio icon indicating copy to clipboard operation
trio-asyncio copied to clipboard

Deadlock on exception in call_later callback, during sleeping

Open shamrin opened this issue 5 years ago • 0 comments

The following deadlocks:

    @pytest.mark.trio
    async def test_raise_sleeping(self, loop):
        def raise_exc():
            raise Exception()

        async def raise_sleeping():
            loop.call_later(0.1, raise_exc)
            await asyncio.sleep(0.2)

        await trio_asyncio.aio_as_trio(raise_sleeping, loop=loop)()

It gets stuck in run_aio_future on wait_task_rescheduled after it hits abort_cb callback:

https://github.com/python-trio/trio-asyncio/blob/b93c32037804298b43cc8c089313a2ef82ca0c22/trio_asyncio/_util.py#L34-L45

The problem exist at least since release 0.11.0.

#88 is potential similar.

(Extracted from #103.)

shamrin avatar Jan 08 '21 00:01 shamrin