-
Notifications
You must be signed in to change notification settings - Fork 90
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
Two instances of HLS started #480
Comments
thanks, would be great to have a reproducible case, maybe we could analyze the opening of files out of the workspace, which seems to be reproducible |
I am experiencing this as well. While I was playing around with it a bit, I noticed between some projects I wasn't always launching the same version of Is "machine" scope set elsewhere? Is it possible that when opening a haskell file outside of my current workspace, it is picking up different options? Also, I remembered that I am using the Just a few thoughts for now. I will try and dig in later to provide some more concrete info. |
This duplication seems to happen randomly for me, but I have no idea how to reproduce. @felixonmars reported this problem to me before, and maybe he could provide more useful information. |
Yes, but unfortunately, it seems to happen randomly for me. Anyway, I'll keep an eye on it. |
could it be related with the use of start/stop or restart commands? |
In this case, I did not use those commands. |
It is not clear sorry. The scope is something you set when you define the variable in the extension and vscode-haskell/src/extension.ts Lines 35 to 39 in 2020488
|
that behaviour is described in #300 |
I get two instances of HLS whenever I open a new (i.e. not previously existing) haskell module file. So let's say in a project that doesn't yet have a Do you need more info to reproduce this? I could put up an example project that shows this behavior, if that'd be helpful. |
An example project would be immensely helpful, yes, please! |
UI issues can be tricky to reproduce, but here's my attempt:
I hope that script is self-explanatory (here's a link). If not let me know. I hope this helps. If you have problems reproducing the behavior with this, let me know. I may find more time to help. I'm using: |
It seems to happen when clicking on Update Yup, definitely matters. If you add the project folder starting from |
I'm hitting this issue. It happens when I have a bunch of files open the the VS Code instance that's running HLS. I don't have any Haskell files from other projects open, though. Here's HLS log file (from VS Code "Output" tab): https://gist.github.com/runeksvendsen/836cf2f510102379ccb59f47dfc6f309 Notice the following errors:
I suspect they happen because two HLS processes are trying to get a lock on the same SQLite DB. |
Your example is reproducible but it is the correct behaviour, in my opinion, you opened a new file that does not belong to the current project, then we need to launch a new HLS instance, since we might need a different GHC version to compile the project. True, the process will linger, if you save the file and make it a part of the cabal project... but I don't know what else we could do in that situation? However, your way of reproducing it gave me an idea, maybe when we switch branches, and we have files that no longer exist after switching... maybe that launches a new instance as well? |
I think I'm encountering the same issue. With multiple instances of HLS being spawned for files that should all be within the same cabal project. I think in this instance it seems to be symlinks causing it, as the notification comes up as setting up the project in one location while VS code claims to be open in another (same actual file, but the paths are different). |
@fendor: Why do you say it does not belong to the current project? At least it's my intention that it should. How does hls determine which files belong to a project and which don't? |
No, you misunderstand, its the same file, just accessed via a different pathname. HLS sees Presumably HLS needs to canonicalise the paths it gets before checking them against the project. |
Ah, I see, I think you are correct, we don't handle the workspaces correctly. |
Does not work with bind mounts. |
In some cases, vscode-haskell starts two instances of HLS (consuming lots of memory).
There is a comment in my bug report on haskell-language-server which suggests, that this happens when opening a .hs file outside of the current project.
In this case, I did not do that - I was only working with files from my current project.
I will attach the (quite large) HLS log file, hoping it will be of help. In a quick search I could not the files corresponding with the launch of the instance though. (This should happen closer to the end of the log file - I opened the task monitor after noticing my Laptop struggling and then closed VS Code)
hls-7.10.2021.log
Edit:
OS is Ubuntu Linux 20.04.3 LTS
GHC version 8.10.4
VS Code 1.60.2
vscode-haskell 1.7.1
Working on GHC source
The text was updated successfully, but these errors were encountered: