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: batch file modification notifications on the server side #41691
Comments
It looks like the The way that |
Thanks, I'm not sure how I had missed the fact these changes can be sent as a batch. I can make this change to fix things in the short term.
I think that implementing a solution for this on the
It wouldn't need to wait, because you could trigger a cache invalidation on the leading edge, collapsing any subsequent notifications you receive whilst the handling of that first invalidation is still in progress. |
I don't think it makes sense to worry about this until we have a concrete issue. I can't think of a scenario where a user would make thousands of changes spread out over a long period of time. Either they're going to make a bunch all at once with a branch change, or a few spread out file-by-file changes. |
Neither can I. This issue is about my experience with Arguably you could say the LSP client ( |
Change https://golang.org/cl/309269 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Working on https://github.com/play-with-docker/play-with-docker, I ran
go mod vendor
whilst I hadgovim
open.vendor
is about 53MB according todu
. This resulted in 6711 calls toDidChangeWatchedFiles
. All of these calls took just under 1s to execute, according to thegovim
logs.But after this,
gopls
spent around 8 minutes at 100% CPU. I would guess it was processing the backlog ofDidChangeWatchedFiles
notifications.However, a single cache invalidation after the last received
DidChangeWatchedFiles
notification would have sufficed.So it would appear that the logic here for processing these notifications is not quite right. They do not contain files contents and so, to my understanding, can be entirely collapsed.
What did you expect to see?
gopls
behaving normally.What did you see instead?
gopls
at 100%.Log files: logs.zip
cc @stamblerre
FYI @leitzler
The text was updated successfully, but these errors were encountered: