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

run_sync does not clean up the pending task after run_until_complete is interrupted #696

Closed
shingo78 opened this issue Sep 22, 2021 · 2 comments · Fixed by #697
Closed

Comments

@shingo78
Copy link
Contributor

When the wrapped method (like BlockingKernelClient.get_shell_msg) is interrupted by KeyboardInterrupt(Ctrl+C), the event loop is interrupted, and the task ( asyncio.Task ) becomes a pending state.
If I call the wrapped method again, it does not return.

I think run_sync should cancel the pending task.
https://stackoverflow.com/questions/30765606/whats-the-correct-way-to-clean-up-after-an-interrupted-event-loop

@davidbrochart
Copy link
Member

Thanks for reporting the issue @shingo78. Do you want to try and open a PR? That would be great.

@shingo78
Copy link
Contributor Author

Thanks. Please review it.

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

Successfully merging a pull request may close this issue.

2 participants