Skip to content
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

regression: 0.28.3 fails to respond to initialize request, stalls and consumes high CPU #95

Closed
siegel opened this issue Mar 19, 2021 · 6 comments

Comments

@siegel
Copy link

siegel commented Mar 19, 2021

I'm working on an LSP client, and hoping to support jedi-language-server. When I started implementing, 0.27.2 was current, and this worked well. However, in testing, one of my testers reported that the client was hanging waiting for jedi-language-server.

Upon investigation, I found that the relevant difference was that the tester was running 0.28.3 rather than my 0.27.2, and upon updating my own installation of jedi-language-server to 0.28.3 I was able to reproduce the same symptom.

Platform: macOS 10.15.7
Python: 3.9.2
jedi-language-server: 0.28.3
Client: n/a

I don't have a clean test harness for reproducing this; I thought I could start jedi-language-server in a Terminal window and pipe or paste JSON into it, but that doesn't seem to work as expected. However, I have provided the JSON that is being sent to the server when it starts up, perhaps that is useful.

The regression is reproducible: use pip install -U jedi-language-server to install the current version (0.28.3 as I write this), and the server never responds to the initialize message. Sometimes it appears to continue running and consume high CPU, I have attached a macOS sample report, in case that is helpful.

Then, use pip uninstall jedi-language-server followed by pip install -Iv jedi-language-server==0.27.2 to install the older version, and the language server responds immediately and as expected to initialize and other protocol requests.

Thanks for reading; please let me know if there's any additional information I can provide.

initialize.json.zip
jedi-ls-sample.txt

@pappasam
Copy link
Owner

pappasam commented Mar 19, 2021

@siegel Given the lack of output we're able to find, I'm guessing at a solution: it's possible that, with a null workspace URI, jedi project creation fails and causes things to hang. I've handled that case in a new branch. Would you be able to test out #97 ?

@siegel
Copy link
Author

siegel commented Mar 19, 2021

@pappasam I would be delighted to test; I can pull and make, but don't have the expertise to install from a clone of the repository. If you don't mind giving me simple n00b instructions, I'll be happy to install it and take it for a spin.

@pappasam
Copy link
Owner

Ok, these instructions should get you up and running:

git clone https://github.com/pappasam/jedi-language-server
cd jedi-language-server
python -m venv venv
source venv/bin/activate
pip install poetry
poetry install
which jedi-language-server

As long as your virtual environment is active, you should be using the development version of jedi-language-server.

@siegel
Copy link
Author

siegel commented Mar 19, 2021

Got it! It didn't go exactly as planned, but I was able to crowbar in a full path to the development build, and confirmed that the server responds as expected to initialization and other requests that I tested.

Thanks very much! I really appreciate the quick fix.

While I'm at it, I just wanted to throw some love your way for generating fully qualified snippet information for function completions. It makes this client developer's life much happier, and my customers will appreciate it as well. ❤️

@pappasam
Copy link
Owner

These changes should be reflected in the latest release

@siegel
Copy link
Author

siegel commented Mar 19, 2021

So, I did pip uninstall jedi-language-server followed by pip install -U jedi-language-server, and did indeed note the new version 0.28.4. However, when starting the server, I get the following (reproducible from the command line):

siegel ~ % jedi-language-server
Traceback (most recent call last):
  File "/usr/local/bin/jedi-language-server", line 5, in <module>
    from jedi_language_server.cli import cli
  File "/usr/local/lib/python3.9/site-packages/jedi_language_server/cli.py", line 5, in <module>
    from .server import SERVER
  File "/usr/local/lib/python3.9/site-packages/jedi_language_server/server.py", line 15, in <module>
    from pygls.lsp.methods import (
  File "/usr/local/lib/python3.9/site-packages/pygls/lsp/__init__.py", line 19, in <module>
    from pygls.exceptions import MethodTypeNotRegisteredError
ImportError: cannot import name 'MethodTypeNotRegisteredError' from 'pygls.exceptions' (/usr/local/lib/python3.9/site-packages/pygls/exceptions.py)

Unclear to me where the issue lies, and it may not be your issue to solve.

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

No branches or pull requests

2 participants