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: blocking queue behavior can cause deadlocks #32631

Closed
muirdm opened this issue Jun 14, 2019 · 1 comment
Closed

x/tools/gopls: blocking queue behavior can cause deadlocks #32631

muirdm opened this issue Jun 14, 2019 · 1 comment
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Milestone

Comments

@muirdm
Copy link

muirdm commented Jun 14, 2019

Now that the gopls jsonrpc queue blocks when full instead of rejecting messages, I've started to get deadlocks starting gopls in Emacs:

  1. Emacs starts gopls
  2. Emacs sends tons of requests/notifications for all open buffers
  3. Somewhere in the middle of 2) gopls sends a configuration request to Emacs
  4. Emacs sends the response, but the gopls's queue is full so go gopls doesn't read it
  5. Deadlock (Emacs is waiting for responses to its requests, gopls is waiting for response to configuration request)

@ianthehat suggested we should either get rid of the configuration request altogether, or rejigger things so that it can be asynchronous.

@gopherbot gopherbot added this to the Unreleased milestone Jun 14, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 14, 2019
@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 <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
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

2 participants