Repository navigation
New language server seems to be frozen at analyzing workspace for more than 30 minutes #2297
Description
Activity
- addedbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
on Aug 1, 2018 I'm experiencing this issue as well.
Relatedly, my vscode is currently in a state where it is not analyzing the workspace, vscode is idle, but
Microsoft.Python.LanguageServer.exeis using 22% CPU. So whileAnalyzing workspace, ${n} items remaining...is one indicator of the issue, it's not the only indicator, and sometimes the language server can spin on its own.Reacted by Tom Faulkner- addedimportantIssue identified as high-priorityIssue identified as high-priority
on Aug 2, 2018 I experience this issue aswell.
- changed the title
[-]New language server seems to frozen at analyzing workspace for more than 30 minutes[/-][+]New language server seems to be frozen at analyzing workspace for more than 30 minutes[/+]on Aug 3, 2018 Here too. Not sure if it is helpful, but I'm also having this pop up in the
OUTPUTtab:[Error - 07:34:56] System.NullReferenceException: Object reference not set to an instance of an object. at System.Object.GetType() at Microsoft.PythonTools.Analysis.Analyzer.ExpressionEvaluator.EvaluateWorker(Node node) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(ClassDefinition node) at Microsoft.PythonTools.Parsing.Ast.ClassDefinition.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node) at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.Analyzer.DDG.WalkBody(Node node, AnalysisUnit unit) at Microsoft.PythonTools.Analysis.ClassAnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval) at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel) at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel) at Microsoft.PythonTools.Intellisense.AnalysisQueue.Worker(Object threadStarted)(and Don Jayamanne (@DonJayamanne) has Microsoft taken over the vscode-python repo? IOW, is this the main repo to track and report issues to?)
DonJayamanne commented
on Aug 7, 2018 on Aug 7, 2018 · Hidden as off-topicAuthorshow commentMore actionsMikhailArkhipov commented
on Aug 7, 2018 More actionsSteve Dower (@zooba) may be interested in microsoft/vscode#55815 as well.
16 remaining items
I've encountered the same problem in my ubuntu 18.04 64bit with vscode 1.27.1, vscode-python 2018.8.0 and python 3.6.5
here is the trace output log:
output log
Starting Microsoft Python language server. Initializing for /usr/bin/python3 Loading files from /home/allenyl/anaconda3/lib/python3.6/site-packages/jieba Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/_compat.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__main__.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_emit.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/__init__.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_trans.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/viterbi.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/char_state_tab.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_start.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/tfidf.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/__init__.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/textrank.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/analyzer.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_emit.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/__init__.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_trans.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_start.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/_compat.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/_compat.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__main__.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__main__.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_emit.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_emit.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/__init__.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/__init__.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_trans.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_trans.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/viterbi.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/viterbi.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/char_state_tab.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/char_state_tab.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_start.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/posseg/prob_start.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/tfidf.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/tfidf.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/__init__.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/__init__.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/textrank.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/textrank.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/analyzer.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/analyse/analyzer.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_emit.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_emit.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/__init__.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/__init__.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_trans.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_trans.py Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_start.py at version -1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/finalseg/prob_start.py Opening document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py Parsing document file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py Waiting for parsing to complete Parsing complete. Waiting for analysis entries to enqueue Parse complete for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py at version 1 Analysis queued for file:///home/allenyl/anaconda3/lib/python3.6/site-packages/jieba/__init__.py Enqueue complete. Waiting for analysis to complete [Error - 下午7:50:09] System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.PythonTools.Analysis.ModuleResolver.GetModuleFullName(String originatingModule, String relativePath) at Microsoft.PythonTools.Analysis.ModuleResolver.ResolvePotentialModuleNames(String importingFromModuleName, String importingFromFilePath, String relativeModuleName, Boolean absoluteImports)+MoveNext() at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Microsoft.PythonTools.Analysis.Analyzer.DDG.TryImportModule(String modName, Boolean forceAbsolute, ModuleReference& moduleRef, IReadOnlyList`1& remainingParts) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(FromImportStatement node) at Microsoft.PythonTools.Parsing.Ast.FromImportStatement.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node) at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker) at Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk(PythonWalker walker) at Microsoft.PythonTools.Analysis.AnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel) at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval) at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel) at Microsoft.PythonTools.Intellisense.AnalysisQueue.GroupAnalysis.Analyze(CancellationToken cancel) at Microsoft.PythonTools.Intellisense.AnalysisQueue.HandleAnalyzable(IAnalyzable item, AnalysisPriority priority, CancellationToken cancellationToken) at Microsoft.PythonTools.Intellisense.AnalysisQueue.ConsumerLoop()and the result of top command:
Although CPU has idled while this small project, the memory consumption seems too high.
the project is https://github.com/fxsjy/jieba
MikhailArkhipov commented
on Sep 13, 2018 More actionsRemaining items in the status bar may be UI issue if CPU load is low. If LS was restarted b/c of exception (most probable cause is microsoft/python-language-server#72) then UI just shows string from the previous instance.
MikhailArkhipov commented
on Sep 13, 2018 More actionsOne thing I noticed here is some symlink folder structures can cause really deep parsing queues to form.
Recursive/looping symlinks can end up propagating pretty deeply and if there's actual content anywhere along the way it will take a long time. For example, given a simple folder structure like this:
/code /test /some test.py /folder /symlink -> ../../some __init__.py (empty) lib.py (empty)And
test.pyis simply "import folder.lib" so we start traversing the tree, I see the following trace output:Initializing for /usr/local/opt/python/bin/python2.7 Loading files from /Users/username/code/test/some Parsing document file:///Users/username/code/test/some/test.py Parsing document file:///Users/username/code/test/some/folder/lib.py Parsing document file:///Users/username/code/test/some/folder/__init__.py Parsing document file:///Users/username/code/test/some/folder/symlink/test.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/lib.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/__init__.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/test.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/lib.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/__init__.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/test.py Parse complete for file:///Users/username/code/test/some/test.py at version -1 Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/lib.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/__init__.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/test.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/lib.py Analysis queued for file:///Users/username/code/test/some/test.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/__init__.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/test.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/lib.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/__init__.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/test.py Parsing document file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/lib.py <more> Parse complete for file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/__init__.py at version -1 Analysis queued for file:///Users/username/code/test/some/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/symlink/folder/__init__.pyI managed to work around this by just adding the suspect symlinks to my VSCode excludes.
There's also some other odd behavior with dead symlinks, but it doesn't seem to act as poorly.
Reacted by Don Jayamanne- added a commit that references this issue
on Sep 15, 2018 Symlink could cause it... I have tons of them (I use zc.buildout, with an extension (omelette) that makes all the eggs used by the project available in the same tree, using symlinks).
I'm not the only one using it... in Zope/Plone world is quite usual that devs use these tools.
It would be great if we can fix it somehow.
samuelpcabral commented
on Sep 17, 2018 More actionsI wondered if it is processing my ./.venv pipenv package folder or some other temporary sub-folder. The number of items it said it was processing seemed much larger than my code base.
True, I didn't take into account that virtualenv also uses symlinks... don't know about pipenv, but I guess it also does it. So, there's a major problem then that might affect the vast majority of people.
It's happening on Windows as well, which doesn't use symlinks for virtualenv (that I know of). Also, my project doesn't use virtualenv.
However, it does use environment variables and mess with
PYTHONPATH, which may be related to the cause.Reacted by Mark Adamson- added a commit that references this issue
on Sep 17, 2018 MikhailArkhipov commented
on Sep 17, 2018 More actions- locked as resolved and limited conversation to collaborators
on Oct 15, 2018



Environment data
Actual behavior
Progress message does not go away
Expected behavior
Progress in status bar must go away.
Steps to reproduce:
Logs
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Output from
Consoleunder theDeveloper Toolspanel (toggle Developer Tools on underHelp)