Skip to content

x/tools/cmd/gopls: locks up with "no room in queue" error #32467

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

Closed
stamblerre opened this issue Jun 6, 2019 · 8 comments
Closed

x/tools/cmd/gopls: locks up with "no room in queue" error #32467

stamblerre opened this issue Jun 6, 2019 · 8 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@stamblerre
Copy link
Contributor

There have been numerous reports of users seeing gopls freeze up, fail all request, and log "no room in queue". This seems to be a symptom of some larger gopls failure, likely a deadlock in the process of type-checking. It has been mentioned in discussions on #32360 and #31977.

@gopherbot gopherbot added this to the Unreleased milestone Jun 6, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 6, 2019
@as
Copy link
Contributor

as commented Jun 6, 2019

This seems to happen because the defaultMessageBufferSize is set to 20 and RejectIfOverloaded is set to true for both client and server conns in jsonrpc2.

https://github.com/golang/tools/blob/master/internal/lsp/protocol/protocol.go#L14
https://github.com/golang/tools/blob/master/internal/jsonrpc2/jsonrpc2.go#L28

I think increasing the default to a more-reasonable 128, or just disabling RejectIfOverloaded should fix this issue.

@as
Copy link
Contributor

as commented Jun 6, 2019

After a bit of discussion, it seems reasonable to point out that this will not fix any request that happens to wedge the server, it would only fix a congestion issue that isn't a result of deadlock.

@k1ng440
Copy link

k1ng440 commented Jun 6, 2019

yes this issue exists for few days/weeks. gopls is being unable to use in windows or WSL

@tonyghita
Copy link

Chiming in with a bit of data... I'm now seeing this issue after the latest release

[Error - 11:23:07 AM] Request textDocument/documentLink failed.
  Message: no room in queue
  Code: -32000 
[Error - 11:23:07 AM] Request textDocument/codeAction failed.
  Message: no room in queue
  Code: -32000 
[Error - 11:23:07 AM] Request textDocument/documentSymbol failed.
  Message: no room in queue
  Code: -32000 
[Error - 11:23:07 AM] Request textDocument/codeAction failed.
  Message: no room in queue
  Code: -32000 

My build information

[Info  - 10:55:10 AM] Build info
----------
version v0.0.1-20190607+alpha, built in $GOPATH mode
Go info
-------
go version go1.12.5 darwin/amd64

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tonyghita/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tonyghita/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gv/vdmq3_l541b_0lq_ds37xslnzgdpkw/T/go-build209673958=/tmp/go-build -gno-record-gcc-switches -fno-common"

@VojtechVitek
Copy link

The "no room in queue" bug was crashing my gopls golangserver in VSCode every couple minutes since 2-3 weeks ago.

Finally, I lost my patience today and switched to "bingo". Hope this helps someone:

go get -u github.com/saibing/bingo

  "go.useLanguageServer": true,
  "go.alternateTools": {
    "go-langserver": "bingo",
    "gopls": "bingo"
  },
  "go.languageServerFlags": [
    "--diagnostics-style=instant",
    "--enhance-signature-help",
    "--format-style=goimports",
    "--goimports-prefix='github.com/pressly'", // enter your own here
  ],
  "go.languageServerExperimentalFeatures": {
    "autoComplete": true,
    "documentSymbols": true,
    "findReferences": true,
    "format": true,
    "goToDefinition": true,
    "goToTypeDefinition": true,
    "hover": true,
    "signatureHelp": true,
    "rename": true,
    "workspaceSymbols": true,
  },

@stamblerre
Copy link
Contributor Author

@VojtechVitek: What version of gopls were you using (gopls version)? This bug is not entirely resolved, but those error messages should not have been appearing as of https://go-review.googlesource.com/c/tools/+/182458.

@VojtechVitek
Copy link

@stamblerre

$ gopls version
version v0.1.0-cmd.gopls, built in $GOPATH mode

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/183718 mentions this issue: internal/jsonrpc2: change the concurrency strategy

@golang golang locked and limited conversation to collaborators Jun 26, 2020
tmc pushed a commit to tmc/clones that referenced this issue Mar 12, 2025
This abandons the limited size queue
Instead we kick a go-routine per request, but have each request wait for the
previous request to say it is okay to continue. This allows each request to
control when it is finished with tasks that required strict ordering without
every blocking the routine that handles replies.
It also protects against repeated or missing replies.

Fixes golang/go#32631
Fixes golang/go#32589
Fixes golang/go#32467
Fixes golang/go#32360
Fixes golang/go#31977

Change-Id: Icd071620052351ec7f8fac136f1b8e3f97d4bb2d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/183718
Run-TryBot: Ian Cottrell <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Rebecca Stambler <[email protected]>
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.
Projects
None yet
Development

No branches or pull requests

6 participants