-
Notifications
You must be signed in to change notification settings - Fork 293
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
Autocomplete hangs the kernel for interactive window #1300
Comments
That's really weird. We have reports of the opposite. Running from the editor being really slow, but directly from the interactive window being fast. The problem is we can't repro in house. Do you have some code and data you can share? |
I found the issue when cleaning this CDC dataset. Just read the csv file and then I also tried with the toy dataset tips in seaborn, which didn't cause any problem. I'm using |
Hmm. I'm reproing. Only goes slow from the interactive window directly. And it's the kernel that's taking a super long time (not our code). But if I run it from the editor, |
And we submit the same code in both cases. I'm guessing this is a kernel issue. In the editor case, we run two executions actually:
whereas in the interactive window we only run the second. And running both of those in the interactive window has no effect on the execution, it still takes a long time. |
And this is not a regression. It repros with 2019.11.50794 |
I take that back. Only sometimes with 2019.11.50794. |
Hi, @rchiodo. just wondering... will this be fixed any time soon? |
Not likely. We have no idea what causes it. It's jupyter that's taking all the time (not our code), so we'd have to debug the jupyter kernel. |
@rchiodo I don't know what the advantage of this jupyter kernel thing but it adds some env I don't want: I feel like I prefer the old extension approach better. |
Those two new 'kernels' represent the environment you're running your python code in. They are an exact match for an environment generated by conda. The advantage is that they will load all of the same packages that the associated conda environment loads. There is no disadvantage other than they are listed there. They have nothing to do with the slowdown you're seeing. The slowdown is in the IPython code itself (which is what I meant by we had to debug the jupyter kernel). The slowdown is not in the code we ship with the ms-python extension. |
@rchiodo any process on this buddy? This happens so frequently and even with small datasets from time to time. |
Do you have the variables list open when this issue occurs? |
not at all I never used that thing |
Sorry but we are not actively investigating this. I believe this is an issue in the IPython code itself and not our own. We don't do anything special to send code to the kernel. |
Could you guys please take a look. This is so weird and really interrupt my workflow. |
I have noticed if I interrupt the kernel when this is taking a long time it comes back immediately. At least for |
Some of the advice here seems to alleviate the problem: I typed this in to the interactive window:
and now it responds immediately. At least with the csv you mentioned above. |
I take that back, it still seems to work. Not sure what the turning off of Jedi does then. |
I don't even use Jedi but only Microsoft language server |
This setting is not for us. It's for jupyter. They use jedi as well for autocomplete. |
If I encounter this issue and try to Interrupt the kernel, the kernel will be forced to restart. |
So you're saying the config setting doesn't work?
|
And interrupting the kernel doesn't always reset the kernel. Depends upon the thing being interrupted. |
I'm a little bit confused about it. Should I set
This is why I don't expect to restart the kernel and now it always does. |
Did you mean this comment?
Sorry that was confusing. I was worried turning of jedi support in jupyter would prevent jupyter from returning autocompletions, but it does not. So I don't see any side effects to this setting:
|
But this will turn off all the autocompletion while I enter code in the interactive window right? and do I have to do this whenever I launch the vscode or the kernel? |
No. It doesn't. That's why I said this:
After changing that setting I was still able to get column names from panda dataframes. This data is not provided by the python extension and explicitly comes from jupyter. So Jupyter still seems to provide autocomplete data even after its jedi usage is turned off. |
Finally had a chance to profile the IPython kernel. The autocomplete from typing is hanging the kernel and preventing the execution of a cell. We should be able to fix this by interrupting the kernel if it's in the middle of autocompletion. |
Longstanding bug, and the workaround seems to alleviate the situation for the most part. Moving to October. |
Why don't we keep track of the pending completion requests & let users know that things are slowing down because of Jedi in the kernel & ask them to just turn this off. Some (if not most, totally guessing here) users will want this, to get better completion. Just like in VS Code core, they let users know what extension is chewing up CPU process & slowing VS Code down, then Users can optionally blitz that extension. Similarly users can opt into disabling jedi completely (we can just add that into a startup command if they click |
Yeah I wanted an automated solution. We didn't originally just make this a startup command because we never spent the time to investigate what the possible side effects of this were. Why is this not the default for jupyter in the first place? |
I agree, we should get to the bottom of the issue, rather and applying a bandaid fix. |
Proposed Solution
|
It looks like we already implemented the 'disable jedi for kernels'. Code is here.
Closing this as I don't repro it anymore with that setting enabled. |
I also had same problem. After some searching online, I think i found how this problem occured and how to alleviate it. This long hangs occured after I updated my conda version and at the same time my ipykernel also needs to update to higher version. I guess it is because of the version of ipykernel. In my case is: 6.4.1.
|
Version: 2020.1.58038 (13 January 2020)
I have a dataframe with shape of (810103, 26). If I type code and run a cell from the editor, everything is fine. But it will be extremely slow if I run code from the interactive window directly such as
df.head()
,df.columns
. I can even make a screenshot without shortcut😂The text was updated successfully, but these errors were encountered: