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
Attempting to interrupt the kernel while autocomplete is thinking crashes the runtime #10733
Comments
Ouch, thanks, we should definitively not crash. I'm slowly thinking on how we can make a better completer, in particular now that master is Python 3 only I have the vague plan on trying to make everything generator/coroutine. I also want to implement a kind of timeout for completer. If you have any ideas about that that they are welcome. |
A very similar issue arises on the code path for non-custom completes (see here). |
This is likely due to completion taking too long, so just return what we have so far, and ignore the interrupt. closes ipython#10733
See ipython#10733, interruption during custom completer can crash the kernel. Technically we should likely even protect normal completion (like jedi taking a while), but let's get something that fix an actual bug. This can lead to some inconsistencies in the frontend, as you interrupt the kernel in Command mode, and interrupting the current custom completer will lead to normal completion being (still) returned and the completer poping up in command mode. It's not optimal but at least we do not loose user state.
See ipython#10733, interruption during custom completer can crash the kernel. Technically we should likely even protect normal completion (like jedi taking a while), but let's get something that fix an actual bug. This can lead to some inconsistencies in the frontend, as you interrupt the kernel in Command mode, and interrupting the current custom completer will lead to normal completion being (still) returned and the completer poping up in command mode. It's not optimal but at least we do not loose user state.
Backstory: we've added some custom completers, some of which do things that amount to making a network request (say to find out the potential arguments to a function). Sometimes, this can be slow, and users are tempted to interrupt their kernel. Doing so then crashes the kernel.
Here's a really goofy repro:
and then interrupt while you're waiting.
A naive fix would be to simply catch any exception here, but I'm not sure if that should happen in a more central place.
In particular, if a user does interrupt a completer, do we want to continue with the next one, or cancel completion completely?
The text was updated successfully, but these errors were encountered: