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

Test coroutine interruption with async client #754

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidbrochart
Copy link
Member

See jupyterlab/jupyterlab#12194.

It looks like interrupting a cell execution which consists of awaiting a coroutine, e.g.:

import asyncio

async def main():
    await asyncio.sleep(5)

await main()

doesn't take effect immediately, but once the coroutine completes execution. This only happens with an async client. It doesn't happen on the Notebook because I think it uses a blocking client.

@davidbrochart davidbrochart marked this pull request as draft March 14, 2022 16:03
@davidbrochart
Copy link
Member Author

davidbrochart commented Mar 14, 2022

Actually it looks more like an ipykernel issue, since akernel stops immediately after interruption.
I tried xeus-python (not raw xeus-python since it doesn't allow awaiting at the top-level), but interrupting such a coroutine leads to the kernel dying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant