Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock on exception in call_later callback, during sleeping #104

Open
shamrin opened this issue Jan 8, 2021 · 0 comments
Open

Deadlock on exception in call_later callback, during sleeping #104

shamrin opened this issue Jan 8, 2021 · 0 comments

Comments

@shamrin
Copy link
Contributor

shamrin commented Jan 8, 2021

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:

def abort_cb(raise_cancel_arg):
# Save the cancel-raising function
nonlocal raise_cancel
raise_cancel = raise_cancel_arg
# Attempt to cancel our future
future.cancel()
# Keep waiting
return trio.lowlevel.Abort.FAILED
try:
res = await trio.lowlevel.wait_task_rescheduled(abort_cb)
return res

The problem exist at least since release 0.11.0.

#88 is potential similar.

(Extracted from #103.)

@shamrin shamrin mentioned this issue Jan 8, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant