-
Notifications
You must be signed in to change notification settings - Fork 28
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
Rogue ruby-lsp related processes even after VS Code is quit #533
Comments
👋 (btw I corrected the spelling in the PR title to make it easier to search for this issue). |
Yeah, I figured as much. I'm not sure I have seen a consistent pattern yet. These processes don't seem to cause issues and are not consuming enough resources to be noticeable right away. I'm trying to think of something to detect this sooner so I can relate that to something I'm doing. To the point of processes running after VS Code has been terminated: Isn't there a mechanism to ensure that child processes are properly terminated? Depending on how the extension spawns those children that should be something that happens automatically by the OS, right? 🤔
Thank you 🙈 |
Here's what we do on shutdown: ruby-lsp-rails/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb Lines 95 to 102 in 6580aa6
|
Disclaimer: I have almost no idea how VS Code extensions or ruby-lsp is structured, so bare with me :) My current theory is that VS Code's
When I kill pid
So #!/usr/bin/env ruby
# load File.expand_path("spring", __dir__)
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands" That might be worth something for the troubleshooting guide, or maybe ruby-lsp-rails/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb Lines 74 to 76 in 6580aa6
DISABLE_SPRING=1 ? Alternatively is there a way to detect that ruby-lsp is running bin/rails , like an environment variable? That way one could disable spring if you don't want to make ruby-lsp aware of spring itself.
|
While not very elegant, adding this to unless ENV.keys.none? { |k| k.include?("VSCODE") }
load File.expand_path("spring", __dir__)
end If there is a more elegant solution, I'm all ears :) ADDED This has of course the downside, that the integrated VS Code terminal won't use spring either :( |
(moving to the rails-lsp-rails repo as this seems specific to that add-on) |
Description
From time to time I notice that there are a bunch of ruby processes where I'm pretty sure they are related to ruby-lsp even if the Rails project got already closed or VS Code is no longer running (see details below).
Ruby LSP Information
VS Code Version
1.95.2
Ruby LSP Extension Version
0.8.13
Ruby LSP Server Version
0.21.3
Ruby LSP Addons
Ruby Version
3.3.5
Ruby Version Manager
chruby
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
Reproduction steps
Unavailable at this time.
I'm not sure if there is something specific I'm doing that leads to the issue. From time to time I just notice that there are a bunch of ruby processes running where I'm either 100% sure (
~/.gem/ruby/3.3.5/gems/ruby-lsp-rails-0.3.23/lib/ruby_lsp/ruby_lsp_rails/server.rb
) or pretty sure (~/.gem/ruby/3.3.5/gems/rb-fsevent-0.11.2/bin/fsevent_watch […]
) that they are spawned/related to ruby-lsp. I'm only using ruby-lsp from within VSCode.There must be something off with process cleanup. Especially after quitting VS Code I'd expect all spawned processes to be properly terminated.
This output is from VS Code being terminated (properly quit, closing all windows before, no crashes reported, etc) –
ps aux
:The text was updated successfully, but these errors were encountered: