-
Notifications
You must be signed in to change notification settings - Fork 133
Recursive or looping symlinks can cause language server to repeatedly analyze files #181
Comments
Yeah, I might have solution |
Most probably no longer applies, so for verification with #432 |
If we create correct PathResolverSnapshot, there should be no problem. |
Tested using this specific example, the new LS does not loop infinitely. There are some other symlink oddities (long import hints, loss of import completion once a symlink is imported), but I'll file separate issues for those. |
Reopening, there may be some other looping issues. |
I actually still experiment this issue with the latest VS Code version (1.32.3). |
From my side, I seem to have problems in looping too (characteristic of the "Analyzing in background, X items left"). But in my side, it's not the file/directory/workspace structure, but more the virtual environment. With a simple file (no import, one function), and using a conda env from another project I got absolutely no problem. STRANGER YET, when going with a blank conda env, with only numpy and sklearn, the same import leads to no problem at all. So it's linked to packages in environment, but there also seems to be a third party factor. Problematic case:Environment
Description of the problemAs many others, with certain workspaces, the "Analyzing in background, X items left" appears, grows to a certain point, sometimes decreases and grows again, until being stuck indefinitely. Sucks up CPU and memory usage. "Simple file" in question:
Content of the problematic conda env (sorry it's not minimal, I didn't find yet a minimal case)
Extract of the python output
SO, some files are queued, while some are completed in a matter of ms. Sorry if I mis-followed the guidelines... |
Please file a new issue; this one is closed and is probably not related. Regarding "only numpy and sklearn", there's a lot behind those libraries which may be affected by things relating to my explanation in #832 (comment). |
Original issue can be found here along with the details microsoft/vscode-python#2613
I commented previously on #2297 but I found that symlinks were still causing problems after I grabbed a recent build today.
Environment data
Actual behavior
The Python language server gets caught in a super deep nest of recursive symlinks. The repro case given completes quickly (there's nothing to analyze) but still demonstrates the problem, I think.
If there is actual code to parse/analyze it pretty much goes on forever. "Analyzing workspace, #### items remaining" goes down and then quickly shoots up, and this repeats over and over.
I can workaround this by adding the offending symlinks/folder structures to a VSCode exclusion list.
Expected behavior
The Python language server should be able to handle these structures in some reasonable way.
Steps to reproduce:
import folder.lib
.folder/symlink/folder/symlink/
folder structure.Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)Symlinks to a common folder (e.g. two projects which have a symlink to the same folder) also get re-analyzed but that's usually okay as analysis is pretty fast in general.
The text was updated successfully, but these errors were encountered: