sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.66k stars 183 forks source link

RuntimeError: Set changed size during iteration #2310

Open djrodgerspryor opened 1 year ago

djrodgerspryor commented 1 year ago

Describe the bug When starting the sorbet language server I get a RuntimeError and a message that the server has crashed.

LSP: starting ['/opt/homebrew/lib/ruby/gems/3.2.0/bin/srb', 'tc', '--typed', 'true', '--enable-all-experimental-lsp-features', '--lsp', '--disable-watchman'] in /Users/drp/dev-environment
Traceback (most recent call last):
  File "/Users/drp/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/transports.py", line 188, in invoke
  File "/Users/drp/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/sessions.py", line 2125, in on_transport_close
  File "/Users/drp/Library/Application Support/Sublime Text/Installed Packages/LSP.sublime-package/plugin/core/windows.py", line 390, in on_post_exit_async
  File "./python3.3/_weakrefset.py", line 60, in __iter__
RuntimeError: Set changed size during iteration
LSP: sorbet crashed (5 / 5 times in the last 180.0 seconds), exit code 1, exception: None

I'm not sure if the crash is causing the exception or vice-versa, but changing a set during iteration looks like an error in sublime LSP either way.

To Reproduce Steps to reproduce the behavior:

  1. Enable sorbet languages server

I'm not sure if it's something specific to my configuration or how the server is behaving that's triggering this.

Expected behavior Either no crash, or a clean server crash with no unexpected errors from sublimelsp itself.

Screenshots

Screenshot 2023-08-16 at 11 48 13 am

Environment (please complete the following information):

rchl commented 1 year ago

I'm not sure if the crash is causing the exception

Yes, it looks like that to me. Which means that fixing the exception wouldn't help with this server crashing.

But yes, there is probably something wrong in LSP that makes it not account for server crashing during certain step in the flow.

Does LSP: Log panel provide more information (you can open it from the Command Palette)?