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

910 not raised on conditional checkpoint in infinite loop #240

Open
jakkdl opened this issue May 1, 2024 · 1 comment
Open

910 not raised on conditional checkpoint in infinite loop #240

jakkdl opened this issue May 1, 2024 · 1 comment

Comments

@jakkdl
Copy link
Member

jakkdl commented May 1, 2024

# this raises 910
async def no_checkpoint():
    if ...:
        await trio.sleep("1")
# and this
async def no_checkpoint():
    while bar():
        if ...:
            await trio.sleep("1")
# but not this
async def no_checkpoint():
    while True:
        if ...:
            await trio.sleep("1")

same for try/except.

The problem likely stems from the fact that the function never returns, and as such it never returns without checkpointing - which is where 910 would trigger. Found it while exploring #227, and would be particularly problematic if/when expanding ASYNC100 to use Visitor91x.

@jakkdl
Copy link
Member Author

jakkdl commented May 1, 2024

A possible solution is adding a dedicated rule for "[infinite] loop without checkpoint in loop body", see #227 (comment)

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