Skip to content
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

x/tools/gopls: high CPU on leftover daemon process after update #37829

Closed
findleyr opened this issue Mar 12, 2020 · 4 comments
Closed

x/tools/gopls: high CPU on leftover daemon process after update #37829

findleyr opened this issue Mar 12, 2020 · 4 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@findleyr
Copy link
Contributor

Forked from @zikaeroh's comment on #34111:
#34111 (comment)

One thing I've noticed after doing a couple of gopls upgrades with this enabled is that the unused process seems to use CPU when I change my project's files even when no session is attached (e.g. I ask VSC to restart the language server, I get a new gopls serve process as the build ID changed, then edit a file while watching htop).

Is gopls doing some sort of extra file watching? I had thought it was only using LSP's file watcher, but the fact that it's responding to edits for files it doesn't have "open" is strange.

@findleyr findleyr self-assigned this Mar 12, 2020
@zikaeroh
Copy link
Contributor

Note that the update here is on gopls, not VS Code itself (though I do trigger an "update" by asking it to restart gopls and it runs the new binary).

@gopherbot gopherbot added this to the Unreleased milestone Mar 12, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 12, 2020
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@findleyr findleyr changed the title x/tools/gopls: high CPU on leftover daemon process after VSCode update x/tools/gopls: high CPU on leftover daemon process after update Mar 12, 2020
@findleyr
Copy link
Contributor Author

findleyr commented Mar 12, 2020

Thanks, that's what I meant (an update triggered from VSCode) but it was poorly worded. Updated the title.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.4.0 Mar 12, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.4.0, gopls/v0.5.0 Apr 2, 2020
@stamblerre stamblerre removed this from the gopls/v0.5.0 milestone Jun 24, 2020
@stamblerre stamblerre added this to the gopls/unplanned milestone Oct 21, 2020
@findleyr
Copy link
Contributor Author

findleyr commented Jul 8, 2021

My best guess was that this was due to redundant gopls processes (binary identity is included in auto-discovery), but this is hard to diagnose/fix, and very minor impact. Unfortunately, it's unlikely that this will ever be fixed directly (though it may be improved by fixes to server shutdown in the new version of the jsonrpc2 library). Closing this issue as infeasible.

@findleyr findleyr closed this as completed Jul 8, 2021
@stamblerre stamblerre removed this from the gopls/unplanned milestone Jul 8, 2021
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants