Repository navigation
fix: wait to start server during language server restart - #1289
IntegerLimit wants to merge 4 commits into
Conversation
|
As of the latest commit, the server is once again stopped before starting, in |
|
I have tested your PR by starting , stoppings again and again with the menu and it seems it is working pretty well! Congrats it is a nice fix.
What do you mean? Your fix is not correct and you have some other problem? |
Thank you! The second point was due to a change I made in the initial commit, where I skipped the However, in the current state of the PR, I have discovered no issues. |
|
@IntegerLimit since long time I wanted to revisit this start , stop restart server because as you have noticed it can have some trouble, like the stop which kill process created by a restart when for instance shutdown takes some times. The main problem is because wrapper share in fields some context like lspStreamProvider which is bad. I think more and more that we should have a given context instance which hosts this provider, the launchFuture etc. Today wen server is starting it initialize lspStreamProvider, launchFuture in fields and old stop could cancel them which is again bad. With context strategy, initialize of the server will have a context instance and stop will have an another context instance and could kill process, cancel launchFuture without killing the process created by the initialize step. I would like to implement my idea with context because even with your PR, you can have some trouble with piped closed error. I can reproduce the problem by emulating a slowInputStteam class which slows down the input stream of the language server. I will ping you when I will have a PR. |
|
Ok, that sounds good. I did notice some further edge cases sometimes, even with my fix, so a rework of the stop/start system is good. |
|
@IntegerLimit could you please try #1303 |
|
Will try as soon as I can. |
|
Please wait again.... It is not finished. |
|
@IntegerLimit please install https://github.com/redhat-developer/lsp4ij?tab=readme-ov-file#testing-nightly-builds and tell me if it fixes your issue. Thanks! |
|
Yes, that seems to have fixed the issue. Thanks! |
|
Closed as superseeded by 9ff4d64. |
This PR makes the following change to the restart function in LSP Wrapper:
This fixes an edge case discovered whilst working on GroovyScript Plugin: due to the server taking long to process the
shutdownrequest, stopping the server takes until the timeout runs out (5 seconds), resulting in the following sequence of events if the server was restarted:stopcalledstartcalled, server startsstopcalled, server stops againFurthermore, even if the server is in the
stoppedstate, starting the server via the console would always result in these events. The only method of recovering from this (prior to this fix) is to disable and re-enable the language server through external means (IDE restart, settings change).This PR is confirmed to fix the above issue.