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
LanguageServerWrapper is not stopped on Eclipse shutdown #681
Comments
Why does |
@basilevs your proposal sounds good. Can you please submit a PR about that? |
Looks good to me as well. @mickaelistria , would we then remove |
I no longer believe that a simple change will help. Stop process needs to be monitored and completed before shutdown of the executors. The new suggested solution is:
I will work on a PR, but ETA is unclear. UPDATE: |
|
Shutdown should not immediately terminate communication. Test eclipse#681
stop() is now synchronous start() calls stop and should not block UI. We move the call to stop to a backgroud thread and restore missing synchronization.
Shutdown should not immediately terminate communication.
stop() is now synchronous start() calls stop and should not block UI. We move the call to stop to a backgroud thread and restore missing synchronization.
Asynchronous nature of stop() helps with quick reaction to closed editors. An attempt to make it asynchronous confused isActive() check. This change reverts the attempt, and allows for monitoring of stopping processing via a returned Future. Note the use of Plafotm.getLog() - ILog can't be received from plugin activator during platform shutdown.
Well, this did not work out - the quick acting stop is required during disconnect, so I had to revert synchronous stop. |
The cleanup on shutdown is special - it intentionally does not remove wrapper registration to prevent reinitialization of wrappers by client code. This way, situation when a wrapper is active after plugin stop is prevented and orderly shutdown is possible.
Note the use of Plafotm.getLog() - ILog can't be received from plug-in activator during platform shutdown.
#688 is ready for review and seems to fix the described problem. |
Eclipse outputs the following error to standard error on shutdown, if any LSP-enabled editors are still opened:
The problem is caused by interruption of the
MessageProducer
on shutdown.Investigation shows, that LSP4E relies on
LanguageServerWrapper
to stop processing before itsExecutor
is shutdown. However, the only way to stop processing is to callLanguageServerWrapper.stop()
and that is not called on shutdown - the call is delayed too much byorg.eclipse.lsp4e.LanguageServerWrapper.startStopTimer()
.AFAIK, this results in forceful termination of child process without a chance for graceful shutdown.
The text was updated successfully, but these errors were encountered: