Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Server is stuck on some file probably #750

Closed
Yanpas opened this issue Mar 14, 2019 · 23 comments
Closed

Server is stuck on some file probably #750

Yanpas opened this issue Mar 14, 2019 · 23 comments

Comments

@Yanpas
Copy link

Yanpas commented Mar 14, 2019

I have a project with over a thousand different python files. I can't use this LS there since it stops respond after some time (renames take infinite time): memory stops to grow after 1.5G resident memory is consumed and CPU load is 12% (100% on one cpu core).

There are no guides here how to provide debug info. I have tried to attach with dotnet debugger, but the stack trace is hidden. GDB doesn't show anything meaningful.

Consider add timeout to parsing threads.

image

@MikhailArkhipov
Copy link

Are you on stable channel or beta? New 0.2+ LS is available at the beta channel.

"python.analysis.downloadChannel": "beta"

@strefethen
Copy link

strefethen commented Mar 14, 2019

I'm having a similar problem with a small project where the Microsoft.Python.Language.Server takes a large amount of CPU and never completes. Intellisense gets stuck showing "Loading...".

@MikhailArkhipov Where does the above line for the beta channel go? I've tried adding it to both User and workspace settings but I get "Unknown configuration setting".

@jakebailey
Copy link
Member

Just stick it in your settings.json. You can ignore the warning; it's an undocumented option for testing.

@strefethen
Copy link

strefethen commented Mar 14, 2019

@jakebailey Thanks for the reply. Is that all that's needed? Is the new LS part of the existing download or should I see some sort of update at some point?

Despite restarted VSC in Activity Monitor I see the LS still chewing away at my CPU.

@jakebailey
Copy link
Member

You need likely need to restart VSC. If you look at the Python output in the output panel, you should see the LS version being used printed.

@Yanpas
Copy link
Author

Yanpas commented Mar 14, 2019

@strefethen did it help you?

I think this setting worth mentioning in README. A way to provide stack trace is good too

@jakebailey
Copy link
Member

This setting won't be needed for very long, we're going to release this to stable once we have a few last things worked out. We spread this info to various issues to get testers who previously had resource/performance issues before we launch it for everybody at once.

@Yanpas
Copy link
Author

Yanpas commented Mar 15, 2019

With beta server doesn't stuck anymore.

Rename still doesn't work at all

And warning undefined variable 'f' appeared in this context:

 with (self.path / 'object.xml').open() as f:
            self.root = ElementTree.parse(f)

@MikhailArkhipov
Copy link

Rename is not implemented yet in the new code base, that is #577

@MikhailArkhipov
Copy link

Could you give a bit more context to the undefined var message? I can't seem to repro with basic case

image

@strefethen
Copy link

@Yanpas I'm still seeing high CPU though I'm not seeing just "Loading..." anymore though I'm not getting identifiers either I just see vars that are in the currently open .py file. It definitely seems like either a) I have some misconfiguration or b) it's just not working.

I haven't had much time to actually debug what's happening so apologies I can't offer more ATM.

@MikhailArkhipov
Copy link

@strefethen - are you on LS 0.1 or 0.2 (beta channel)

@strefethen
Copy link

@MikhailArkhipov I'm sorry, I really haven't dug into the beta channels at all and I'm just using the setting mentioned above so I really don't know. How can I tell? Nothing new seemed to update when I added the above setting AFAICT and I've restarted VSC multiple times. I did get a "VSCode wants to install help..." message this morning but I don't know what specifically updated.

@MikhailArkhipov
Copy link

There should be a message in the output window telling version of the LS when it starts. Something like

[Info  - 10:48:57 AM] GetCurrentSearchPaths C:\Python\Python37\python.exe 
[Info  - 10:48:57 AM] Python search paths:
[Info  - 10:48:57 AM]     c:\python\python37\dlls
[Info  - 10:48:57 AM]     c:\python\python37\lib
[Info  - 10:48:57 AM]     c:\python\python37
[Info  - 10:48:57 AM]     c:\python\python37\lib\site-packages
[Info  - 10:48:57 AM] Configuration search paths:
[Info  - 10:48:57 AM]     C:\Python\Python37\python37.zip
[Info  - 10:48:57 AM]     C:\Python\Python37\DLLs
[Info  - 10:48:57 AM]     C:\Python\Python37\lib
[Info  - 10:48:57 AM]     C:\Python\Python37
[Info  - 10:48:57 AM]     C:\Python\Python37\lib\site-packages
[Info  - 10:48:57 AM]     .
[Info  - 10:48:57 AM]     C:\Python\Python37
[Info  - 10:49:01 AM] Microsoft Python Language Server version 0.2.....

@strefethen
Copy link

@MikhailArkhipov I was seeing that sort of output the other day but I'm not seeing that now. I'm opening VSC in a folder with a Python application running on OSX. I've just uninstall/reinstalled both the MSFT Python extension and the VS Intellicode extension and I get zero content in the Output console opening a .py file. I'm using Python 3.6.5 and VSC 1.32.3.

@jakebailey
Copy link
Member

Have you selected the "Python" option for the output panel? There's a dropdown on the right.

@strefethen
Copy link

strefethen commented Mar 15, 2019

🤦‍♂️ No.

Here's the output:

Starting Microsoft Python language server.
[Info  - 11:14:31 AM] GetCurrentSearchPaths /usr/local/bin/python 
[Info  - 11:14:31 AM] SearchPaths:
[Info  - 11:14:31 AM]     /private/var/folders/yp/pq3y7gh534q1ffdmx1gzb4780000gr/T/idpkrest.b0r
[Info  - 11:14:31 AM]     /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6
[Info  - 11:14:31 AM]     /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
[Info  - 11:14:31 AM]     /Users/strefethen/Library/Python/3.6/lib/python/site-packages
[Info  - 11:14:31 AM]     /usr/local/lib/python3.6/site-packages
[Info  - 11:14:31 AM]     /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python36.zip;/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6;/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload;/Users/strefethen/Library/Python/3.6/lib/python/site-packages;/usr/local/lib/python3.6/site-packages;
[Info  - 11:14:31 AM]     /
[Info  - 11:14:31 AM]     /usr/local/bin
##########Linting Output - pylint##########

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

@MikhailArkhipov
Copy link

OK, look into the languageServer folder under the extension folder (VSC command 'Open Extensions Folder'), which one do you see Microsoft.Python.Analysis.dll or Microsoft.Python.Analysis.Engine.dll?

@strefethen
Copy link

strefethen commented Mar 15, 2019

I see the following:

./ms-python.python-2019.2.5558
    /languageServer.0.1.80
        Microsoft.Python.Analysis.Engine.dll
    /languageServer.0.2.17
        Microsoft.Python.LanguageServer.dll
        /bin/release
            Microsoft.Python.Analysis.dll

I'm guessing having both versions is not a good thing (tm).

@jakebailey
Copy link
Member

jakebailey commented Mar 15, 2019

It's fine, the most recent one would be used. You may want to restart your editor (if you haven't recently) to trigger an update to the latest version (0.2.23 at the moment).

In your settings.json, add the following:

"python.analysis.logLevel": "Trace"

You'll get more info in the output panel than before. (I wouldn't recommend pasting all of it, but if something is getting stuck you should see the output stop moving.)

@jakebailey
Copy link
Member

And if the extension doesn't update the language server, you can delete those languageServer directories and the download will be forced.

@strefethen
Copy link

@jakebailey I now have 0.2.23, my CPU has settled down and Intellisense looks to be working.

Really appreciate your help! Thank you.

@MikhailArkhipov
Copy link

Closing then

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

No branches or pull requests

4 participants