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: codeaction taking ~6 seconds for no apparent reason #36776

Closed
myitcv opened this issue Jan 26, 2020 · 4 comments
Closed

x/tools/gopls: codeaction taking ~6 seconds for no apparent reason #36776

myitcv opened this issue Jan 26, 2020 · 4 comments

Comments

@myitcv
Copy link
Member

@myitcv myitcv commented Jan 26, 2020

What version of Go are you using (go version)?

$ go version
go version devel +73d213708e Sat Jan 25 16:34:18 2020 +0000 linux/amd64
$ go list -m golang.org/x/tools
golang.org/x/tools v0.0.0-20200124220429-8fe064f891f2
$ go list -m golang.org/x/tools/gopls
golang.org/x/tools/gopls v0.1.8-0.20200124220429-8fe064f891f2

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOENV="/home/myitcv/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/myitcv/gos"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myitcv/.vim/plugged/govim/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-build563121321=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Per the following gopls log file: gopls_20200126_1322_54_956033106.log, a CodeAction call took ~6.3 secs when there was no apparent reason for the delay.

[Trace - 13:26:53.641 PM] Sending request 'textDocument/codeAction - (2)'.
Params: {"textDocument":{"uri":"file:///home/myitcv/gostuff/src/myitcv.io/cmd/gitbranchgraph/main.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":null}}


[Trace - 13:27:00.029 PM] Received response 'textDocument/codeAction - (2)' in 6388ms.
Result: {}

As you can see the preceding change was not very interesting:

[Trace - 13:26:52.001 PM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"version":48,"uri":"file:///home/myitcv/gostuff/src/myitcv.io/cmd/gitbranchgraph/main.go"},"contentChanges":[{"range":{"start":{"line":45,"character":0},"end":{"line":46,"character":0}},"text":"\toriginsToLocals := make(map[string]bool)\n"}]}

What did you expect to see?

Near instant response.

What did you see instead?

~6.3 sec delay.

Tentatively marking as v0.3.0


cc @stamblerre @heschik

FYI @leitzler

@myitcv myitcv added this to the gopls/v0.3.0 milestone Jan 26, 2020
@gopherbot gopherbot added the Tools label Jan 26, 2020
@myitcv
Copy link
Member Author

@myitcv myitcv commented Jan 26, 2020

FWIW this appears to be related to changes I'm also seeing in my go.mod file. i.e. something is triggering additional requirements to be added to the main module. Now that I've spotted this I'll try and remember to capture both the logs and the changes to go.mod next time.

@stamblerre stamblerre changed the title x/tools/gopls: codeaction taking ~6 sections for no apparent reason x/tools/gopls: codeaction taking ~6 seconds for no apparent reason Jan 26, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.3.0, gopls/v1.0.0 Jan 26, 2020
@myitcv
Copy link
Member Author

@myitcv myitcv commented Jan 28, 2020

Given conversations with @stamblerre on Slack, I wonder whether what I'm reporting here was related to https://go-review.googlesource.com/c/tools/+/216542?

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jan 28, 2020

I would be surprised if it was related to this, but let's revisit this once you're able to get a repro case.

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 11, 2020

I'm going to close this issue since it doesn't seem to be reproducible. Please open a new issue with a repro case if this comes up again.

@stamblerre stamblerre closed this Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.