-
Notifications
You must be signed in to change notification settings - Fork 203
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
Python LSP server completely stops working after a cancel notification is received #114
Comments
Same here from using nvim 0.6.1 with the following config: nvim_lsp.pylsp.setup(require('coq').lsp_ensure_capabilities({
settings = {
pylsp = {
configurationSources = {'flake8', 'pycodestyle'},
plugins = {
jedi_completion = {
fuzzy = true,
},
flake8 = {
enabled = true,
config = ".flake8",
},
pycodestyle = {
enabled = true,
},
mccabe = {
enabled = true,
},
preload = {
enabled = false,
},
pydocstyle = {
enabled = true,
},
pylint = {
enabled = false,
},
pyflakes = {
enabled = false,
},
rope_completion = {
enabled = true,
},
yapf = {
enabled = false,
},
},
},
},
flags = {
debounce_text_changes = 150,
},
})) The process
|
@m0wer, please describe step by step how to set up a Neovim instance with LSP and this server working. That way I could reproduce this error on my side and then try to fix it. |
Hi, I started having this problem yesterday, |
@ccordoba12 this is quite easily reproducible in emacs with |
This is what the sample log lines in my log looks like:
|
I'm having the same issue with My configuration is: {
settings = {
pylsp = {
plugins = {
configurationSources = { "flake8" },
autopep8 = { enabled = false },
flake8 = { enabled = true },
mccabe = { enabled = false },
preload = { enabled = false },
pycodestyle = { enabled = false },
pydocstyle = { enabled = false },
pyflakes = { enabled = false },
pylint = { enabled = false },
yapf = { enabled = false },
-- https://github.com/python-rope/pylsp-rope
rope_auto_import = { enabled = false, memory = false },
rope_completion = { enabled = false, eager = false },
-- 3rd party plugins
-- https://github.com/Richardk2n/pylsp-mypy
pylsp_mypy = {
live_mode = false,
report_progress = true,
dmypy = true,
},
isort = { enabled = true },
black = { enabled = true, cache_config = true },
ruff = { enabled = true },
-- Jedi configuration
jedi_hover = { enabled = true },
jedi_signature_help = { enabled = true },
jedi_references = { enabled = true },
jedi_symbols = { enabled = true },
jedi_definition = {
enabled = true,
follow_imports = true,
follow_builtin_imports = true,
follow_builtin_definitions = true,
},
jedi_completion = {
enabled = true,
include_params = true,
include_class_objects = false,
include_function_objects = false,
fuzzy = false,
eager = false,
resolve_at_most = 25,
cache_for = {
"pandas",
"numpy",
"tensorflow",
"matplotlib",
"pydantic",
"fastapi",
"flask",
"sqlalchemy",
"dagster",
},
},
},
},
},
} |
same issue with neovim 0.8.3 or 0.9.1 |
same issue with neovim nightly |
We'll see what we can do about this problem in our next version. |
@ccordoba12 I was able to get this warning message in logs, but I wasn't able to reproduce some of the issues others described around slowing performance or logs getting flooded. At a high level, though, it seems like it must be related to clients that don't throttle requests because they assume they can be cancelled. Whenever I saw The most straightforward solution I see is to implement server-side throttling in Then the question remains of what to do about the log messages, e.g. for client attempts to cancel a non-cancellable request, but also for logging warnings when requests are getting throttled. I think it probably makes sense to keep the log level at warning, because in my opinion, it indicates a client misbehavior that the client library maintainer has a responsibility to fix. However, we can also introduce another layer of throttling within the logger itself, so that we at least aren't flooding logs. I think all of this throttling logic probably belongs in How does this sound do you? If it sounds OK, I'd be happy to take a stab at contributing an implementation. |
Thanks for your careful thinking about this @smacke! Your proposed plan sounds good to me.
Agreed.
Agreed too.
Yep, I think so too.
Sounds good to me. My only question is this: what if we make the server fully async? (there's python-lsp/python-lsp-jsonrpc#12 as a starting point). I mean, I don't know if this problem would be automatically solved if we do that instead. |
I'm also getting this warning on Kate editor. |
as many people i'm getting this warning (kde kate editor) |
Just hit the same on kate :( |
I installed pylsp and all required modules.
When using python-lsp-server I see the following warning
"2021-11-14 15:12:47,855 CET - WARNING - pylsp_jsonrpc.endpoint - Received cancel notification for unknown message id 10"
and then everything stops working : the auto-completions, linting, signature help.
I am a spacemacs user (=emacs). A lot of other users (including some people using different IDE) have experienced this issue. See:
palantir/python-jsonrpc-server#17
python-lsp/python-lsp-jsonrpc#5
emacs-lsp/lsp-mode#1731
palantir/python-jsonrpc-server#17
Any ideas on what could be the problem ?
Best,
Hugo
The text was updated successfully, but these errors were encountered: