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: slow packages.Loads with cgo #43560
Comments
If you want to disable code actions, I think the right syntax is |
Hey @hyangah here's a trace. |
It looks like your log may be incomplete--I would expect it to start with an Also, I notice that there are 2 extensions listed in the pop-up here--does disabling the "GitHub Pull Requests and Issues" extension fix the problem? |
@stamblerre did you read the attached text file as well? It covers the whole period of the hangup, not all they way from the start of vs code. Isn't that enough? |
Yes, I did read that file, but |
@stamblerre here's one all the way from the beginning |
On further usage, right now, when I e.g. run the tests, the Go extension starts compiling the program. If I cancel the tests, it doesn't stop the compilation, it keeps running on the remote server. Now every time I save a Go file it stalls for 2 minutes as it's waiting for the compilation to end. Edit: actually, whenever I save a file, it starts compiling the whole program. If I save numerous time one after another, for each save, it starts the whole process of compiling the program. It's a cgo program. |
Hey @stamblerre any updates on the topic? I suppose we are still not "waiting for info"? This makes VS code impossible to use for me |
Apologies, I must've missed your response. Does setting |
Ah, I see it's also related to running the tests. Does it work if you don't run the tests, or are the saves still slow then? |
It's unrelated to testing, although "Build on save" is set to package, the default value |
That setting doesn't actually apply when the language server is enabled. To follow up on some of my earlier questions:
|
Hey @stamblerre still seeing this issue.
|
You can set |
That's fine. The big issue still is that it tries to build my Go project each time I save the file. Being a cgo project, that takes several minutes. |
Is this still happening with |
Hey @stamblerre please see my previous comment 6 hours ago, in which I explained that it is indeed not happening when I set go.useLanguageServer false. |
Thank you for the clarification. I've transferred and retitled this issue, and we will try to investigate it more thoroughly when possible (likely not in the next month). In the meantime, we hope the workaround of disabling the language server will be sufficient. |
I've noticed huge lag/deadlock with gopls as well and initially attributed it to a large package set (some recent work was done for that, but still seeing intermittent deadlocks now). But perhaps this has bearing as well since my project I believe relies upon some c-libraries. These periodic machine hangs where I see gopls pegging my cpu at 290% for 10-20 seconds at a time make me want to just turn it off. |
@mrjrieke: Can you please open a separate issue so that we can investigate your problem separately? Please include the information requested in the troubleshooting guide. |
I think this may in fact be fixed at last (for me at least). Re-enabled Language Server in vscode. I am on latest version go gopls available to me anyways: I now have a pleasant debugging experience in the project I was trying to develop in vscode that prior caused my machine to brick. Thanks for all the hard work that went into gopls to improve the performance. |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gogopls -v version
to get version of Gopls if you are using the language server.code -v
orcode-insiders -v
to get version of VS Code or VS Code InsidersCommit: 76436a4d43566cd313629799e2ec51b4d00caa64
Date: 2020-12-11T17:46:02.603Z
Electron: 11.0.3
Chrome: 87.0.4280.67
Node.js: 12.18.3
V8: 8.7.220.25-electron.0
OS: Darwin x64 20.1.0
go env
to get the go development environment detailsGOARCH="amd64"
GOBIN=""
GOCACHE="/home/toni/.cache/go-build"
GOENV="/home/toni/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/toni/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/toni/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/toni/sdk/go1.15.6"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/toni/sdk/go1.15.6/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/toni/go/src/github.com/davidbyttow/govips/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build840047076=/tmp/go-build -gno-record-gcc-switches"
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes."go.formatTool": "goimports",
"go.useLanguageServer": true,
"go.coverageDecorator": {
"type": "gutter"
},
"go.coverOnSingleTest": true,
"go.coverOnSingleTestFile": true,
"go.coverageOptions": "showUncoveredCodeOnly",
"editor.codeActionsOnSave": null
Describe the bug
Every now and then, for months now with various Go extensions and Go nightly extensions, when I save a Go file, VS code stalls for a couple of minutes saying "Getting code actions from Go"
The stall is about two minutes. As you can see from the screenshot, editor.CodeActionsOnSave is null.
Steps to reproduce the behavior:
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
The text was updated successfully, but these errors were encountered: