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

quattro.fail_after(0) and and quattro.fail_after(-1) cancellation is delayed #2

Closed
graingert opened this issue Jul 20, 2022 · 1 comment

Comments

@graingert
Copy link

graingert commented Jul 20, 2022

see also python/cpython#95051

Bug report

I expect this to raise a TimeoutError:

async def amain():
    with quattro.fail_after(-11):
        await asyncio.sleep(0)

asyncio.run(amain())

Instead I have to add an extra asyncio.sleep(0) to get a TimeoutError

async def amain():
    with quattro.fail_after(-11):
        await asyncio.sleep(0)  # does not raise CancelledError
        await asyncio.sleep(0)  # raises CancelledError

asyncio.run(amain())

Your environment

  • CPython versions tested on: 3.10 and 3.11
  • Operating system and architecture:

here's a comparison, note that uvloop's call_later behaves like call_soon in this case:
https://gist.github.com/graingert/7628f87a629d15cce88f91d6c8cbb1b6

@Tinche
Copy link
Owner

Tinche commented Nov 29, 2023

This got fixed!

@Tinche Tinche closed this as completed Nov 29, 2023
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

2 participants