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

Analysis is stuck if packages are reloaded before it finishes. #1839

Closed
danzvara opened this issue Dec 13, 2019 · 5 comments · Fixed by #1841
Closed

Analysis is stuck if packages are reloaded before it finishes. #1839

danzvara opened this issue Dec 13, 2019 · 5 comments · Fixed by #1841
Assignees
Labels
bug Something isn't working

Comments

@danzvara
Copy link

danzvara commented Dec 13, 2019

I'm trying to run MLSP in docker container to provide completions for a project i'm working on.
When running on a local machine / VM, everything works fine. In docker container however, the analysis gets stuck, until I trigger a filesystem operation such as running pip install. If I skip the initial workspace/didChangeConfiguration notification, analysis finishes fine.

Reading the code, I'm led to believe this is a problem with PathsWatcher class, which only gets created after workspace/didChangeConfiguration is called. It seems like it could be an issue with running System.IO.FileSystemWatcher in containerized environment, but i'm not 100% sure.

Environment data

  • Language Server version: 0.5.7.0 (also tried 0.4.127)
  • OS and version: Debian 9 (on MacOS host)
  • Python version: 3.7.3

Expected behaviour

Analysis should go through all the packages and finish.

Actual behaviour

In docker, analysis never finishes with "Analysis restarted" message appearing before it gets stuck. When a filesystem operation is made (such as pip install), analysis gets reseted again and this time it finishes fine.

Logs

IN: marks a raw input send to MLSP, OUT: is the raw output i'm getting back. The communication is done through my custom LSP plugin in NodeJS, using vscode-jsonrpc package for jsonrpc comms.

There are 2 logs, first part is until the analysis got stuck, the second is then after I ran pip install in the container, analysis got unstack and finished.

Part 1:
https://gist.github.com/danzvara/8fcd139f5568d38e87957fd6dc3bc9dd

Part2:
https://gist.github.com/danzvara/07f94ceffecb071ab2c6e0e2d5101c75

Thanks for any help!

@MikhailArkhipov
Copy link

MikhailArkhipov commented Dec 13, 2019

Related #1623. Yes, file watcher tries to determine if pip install happened or otherwise set of libraries have changed. Perhaps activating watcher should be an option since it technically a convenience feature.

@MikhailArkhipov
Copy link

Looks like same as #1800

@danzvara
Copy link
Author

So I investigated further - it turns out that workspace/didChangeConfiguration triggers a call to ResetAnalyzer(). It seems like if the analysis is reseted before it finishes it gets stuck.

@danzvara danzvara changed the title Analysis is stuck in docker environment, suspecting System.IO.FileSystemWatcher Analysis is stuck if packages are reloaded before it finishes. Dec 16, 2019
@danzvara
Copy link
Author

danzvara commented Dec 16, 2019

Actually, this is not a docker issue. In VSCode Online visualstudio.microsoft.com/services/visual-studio-online, I can trigger the same issue by running pip install something before the initial analysis is done (and their environment seems to be a VM, not a container).

@MikhailArkhipov
Copy link

File watch turned off by default in #1841.
LS 0.5.10+

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants