Skip to content

x/tools/gopls: jsonrpc worker goroutine can get stuck #32589

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
muirdm opened this issue Jun 13, 2019 · 3 comments
Closed

x/tools/gopls: jsonrpc worker goroutine can get stuck #32589

muirdm opened this issue Jun 13, 2019 · 3 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@muirdm
Copy link

muirdm commented Jun 13, 2019

My gopls got stuck with "no room in queue" errors because the "workspace/configuration" call gopls made to Emacs never got a response. Emacs didn't respond because I had an error in my config, but it seems like we either need a timeout or more goroutines to avoid getting stuck in the case the server doesn't respond properly.

/cc @ianthehat

@gopherbot gopherbot added this to the Unreleased milestone Jun 13, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 13, 2019
@myitcv
Copy link
Member

myitcv commented Jun 13, 2019

I'm not sure I'm a huge fan of timeouts.... they tend to mask underlying, bigger problems.

The "no room in queue" errors are a derivative error of the underlying in this case, correct?

@muirdm
Copy link
Author

muirdm commented Jun 13, 2019

Yes, I got "no room in queue" because the worker goroutine was not reading off queue, so the queue filled up.

@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

3 participants