I am trying to reload the package with AutomaticPackageReloader, after restarting the server a few times, but LSP is not shutting down:
[Package Reloader] begin ======================================================
LSP: --> shutdown
Traceback (most recent call last):
File "F:\SublimeText\Data\Packages\AutomaticPackageReloader\package_reloader.py", line 69, in <lambda>
sublime.set_timeout_async(lambda: self.run_async(pkg_name))
File "F:\SublimeText\Data\Packages\AutomaticPackageReloader\package_reloader.py", line 88, in run_async
reload_package(pkg_name, verbose=pr_settings.get('verbose'))
File "F:\SublimeText\Data\Packages\AutomaticPackageReloader\reloader\reloader.py", line 40, in reload_package
sublime_plugin.unload_module(modules[m])
File "F:\SublimeText\sublime_plugin.py", line 61, in unload_module
module.plugin_unloaded()
File "F:\SublimeText\Data\Packages\LSP\boot.py", line 26, in plugin_unloaded
shutdown()
File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 49, in shutdown
unload_all_clients()
File "F:\SublimeText\Data\Packages\LSP\plugin\core\clients.py", line 65, in unload_all_clients
unload_client(client)
File "F:\SublimeText\Data\Packages\LSP\plugin\core\clients.py", line 113, in unload_client
client.send_request(Request.shutdown(), lambda response: on_shutdown(client, response))
File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 59, in send_request
self.send_payload(request.to_payload(self.request_id))
File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 86, in send_payload
self.process.stdin.flush()
OSError: [Errno 22] Invalid argument
Related:
It sounds like the language server had already exited before you reloaded the package, in which we may not have cleaned up the entry in window_clients.
Any idea under what condition the language server had exited?
Ok, if you can narrow down what causes this error or the hangs then we look
at stabilizing some of it.
On Sun, Jan 21, 2018 at 10:10 PM Evandro Coan notifications@github.com
wrote:
>
- I had restarted the server (LSP: Restart Server command), but after
it never responded. Now I do not remember if I had killed by my task
manager the running instance of the Server after it.- But sometimes after restarting a few times, Sublime Text hangs
completely with 0% CPU usage (Server and Sublime Text), but Sublime Text
unhangs after I kill all running instances of the Server.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tomv564/LSP/issues/250#issuecomment-359281224, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AEMTOB7zgfOd9UuFElxlr9CFyO4CogZpks5tM6e-gaJpZM4Rl5d_
.
I will keep watching this, until I see some pattern which allows me to reproduce it.
Yeah, I confirmed, I just killed all the instances of the running server and this showed up:
LSP: --> textDocument/didSave
Traceback (most recent call last):
File "F:\SublimeText\sublime_plugin.py", line 487, in on_post_save_async
callback.on_post_save_async(v)
File "F:\SublimeText\Data\Packages\LSP\plugin\core\documents.py", line 211, in on_post_save_async
Events.publish("view.on_post_save_async", view)
File "F:\SublimeText\Data\Packages\LSP\plugin\core\events.py", line 28, in publish
listener(*args)
File "F:\SublimeText\Data\Packages\LSP\plugin\core\documents.py", line 169, in notify_did_save
client.send_notification(Notification.didSave(params))
File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 63, in send_notification
self.send_payload(notification.to_payload())
File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 86, in send_payload
self.process.stdin.flush()
OSError: [Errno 22] Invalid argument
And this when trying to reload the package:
[Package Reloader] begin ======================================================
LSP: --> shutdown
2018-01-22 22:54:24,739 UTC - DEBUG - pyls.server - Got message: b'{"jsonrpc": "2.0", "id": 4, "method": "shutdown", "params": {}}':
2018-01-22 22:54:24,740 UTC - DEBUG - pyls.server - Server shut down, awaiting exit notification:
LSP: --> exit
LSP: --> shutdown
2018-01-22 22:54:24,743 UTC - DEBUG - pyls.server - Got message: b'{"jsonrpc": "2.0", "method": "exit", "params": {}}':
Traceback (most recent call last):
File "F:\SublimeText\Data\Packages\AutomaticPackageReloader\package_reloader.py", line 69, in <lambda>
sublime.set_timeout_async(lambda: self.run_async(pkg_name))
File "F:\SublimeText\Data\Packages\AutomaticPackageReloader\package_reloader.py", line 88, in run_async
reload_package(pkg_name, verbose=pr_settings.get('verbose'))
File "F:\SublimeText\Data\Packages\AutomaticPackageReloader\reloader\reloader.py", line 40, in reload_package
sublime_plugin.unload_module(modules[m])
File "F:\SublimeText\sublime_plugin.py", line 61, in unload_module
module.plugin_unloaded()
File "F:\SublimeText\Data\Packages\LSP\boot.py", line 26, in plugin_unloaded
shutdown()
File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 49, in shutdown
unload_all_clients()
File "F:\SublimeText\Data\Packages\LSP\plugin\core\clients.py", line 65, in unload_all_clients
unload_client(client)
File "F:\SublimeText\Data\Packages\LSP\plugin\core\clients.py", line 113, in unload_client
client.send_request(Request.shutdown(), lambda response: on_shutdown(client, response))
File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 59, in send_request
self.send_payload(request.to_payload(self.request_id))
File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 86, in send_payload
self.process.stdin.flush()
OSError: [Errno 22] Invalid argument
Okay, I added OSError to the exception handler when writing to stdin.
Thanks! Finally the server can rest in peace and restart without restarting Sublime Text.
Most helpful comment
Okay, I added OSError to the exception handler when writing to stdin.