-
Notifications
You must be signed in to change notification settings - Fork 284
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
Took 2 minutes to respond to on_hover(), from 15:56:14 until 15:58:38 #257
Comments
@evandrocoan are you still seeing this issue? |
Yes. But now it is so frequently that I just kill the language server process and do not start it anymore. I cannot have my work stopping randomly and frequently for such long periods. In my opinion the worst part of this issue is the LSP plugin for Sublime Text completely freeze the Sublime Text Graphical User Interface (other times not the User Interface but all Sublime Text Async Tasks running in the background) until the language server respond. |
i'm sorry to hear that! I think theres two problems to address here.
What are your thoughts? Would you be interested in tackling either of those? |
My first though would be to understand: I do not think it is a big problem taking long as 2 minutes to answer a request, as long as My first approach to solve this will be updating my fork of LSP to time out the requests after something like After solving this on the LSP plugin, I would dig in into what the
I am not sure about what are the implications of an async hover call backs. How would they respond accordingly to the time out I am implementing on the LSP plugin? If I understand correctly, currently
However, it can be actually required by the This is very similar to this problem on the
I would suggest to not implement async hover requests, before investigate what is causing or can cause to a request take so long to be finished. After learning this, we can correctly think about a implementation strategy to correctly create async hover requests, without:
Hence, if the server implements async hover requests:
The solution to this, is to implement async requests on the LSP plugin. But first, fix it blocking the Sublime Text interface. Adding support to async requests is also on the way of fixing LSP. If the LSP plugin is doing and receiving async requests, it should be able to not block Sublime Text until some request being completed after they being created. Even with an async LSP plugin, there will be still existing discarded requests after the time out. For example, the LSP plugin does the request A, and do not wait for its answer, it starts doing other stuff. Then when the requests A timeout comes, and the request A have not yet being fulfilled, then it considers it invalid or not found and display to the user this result. |
Hey sorry for the slow response! With regards to the LSP changes: As a quick fix to get things running it seems reasonable. But as a long term solution I don't think the approach is correct. Clients should not pyls hover: Sure, perhaps making it async isn't a complete solution to your problem but I do think that it is the correct thing to do long term. Since a client can cancel a hover request we are basically using users patience as an upper bound on computation time. Furthermore, it adds overall responsiveness to the server. Also important to note, the async requests may operate on multiple |
@evandrocoan can you paste the output of I agree that async might not be the correct answer here, as we'll very quickly just end up starving the executor pool and blocking all requests! Let's try and find the root cause. Would be happy to add some log lines into the hover provider to help with timings. |
My computer is like 5 times slower than the usual, then we could recude these 2 minutes to 24 seconds on today's machines.
But my
|
Originally posted on: sublimelsp/LSP#255 python-language-server hanged Sublime Text by several seconds on file close event
This caused the LSP plugin for Sublime Text to hang completely for the 2 minutes the server did not responded to the
on_hover
request. I do not think there is an issue here if that is what does take to compute everything. Unless it doesn't.This was the LSP for Sublime Text log. Sadly it does not have the timestamp. I am going to open a feature request for:
Log:
The text was updated successfully, but these errors were encountered: