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: type checking deadlock #32638

muirdm opened this issue Jun 16, 2019 · 1 comment

x/tools/gopls: type checking deadlock #32638

muirdm opened this issue Jun 16, 2019 · 1 comment


Copy link

@muirdm muirdm commented Jun 16, 2019

I managed to hit a type checking deadlock. All goroutines involved were waiting on <-e.ready in getPkg in lsp/cache/check.go, which suggests some sort of impossible circular dependency. In the debugger I found the below getPkg call chains from each goroutine:

go/build <-
go/doc <- go/build <-
encoding/json <-
net/url <- crypto/x509 <- crypto/tls <- net/http/httptrace <- net/http <- encoding/json <-
encoding/json <- net/url <- text/template <- go/doc

It is a deadlock, but the encoding/json <- net/url edge jumped out as not quite right until I noticed that "net/url" imports "encoding/json" in its test. So, due to the package variant issue, we are hitting circular dependencies. In particular, in this case when "text/template" imports "net/url", we ended up importing the test variant of "net/url" that also has an import for "encoding/json".

Once the variant issue is resolved so that importer.Import only ever imports the non-test variant, this issue should be resolved as well.

/cc @stamblerre @ianthehat

@gopherbot gopherbot added this to the Unreleased milestone Jun 16, 2019
@gopherbot gopherbot added the gopls label Jun 16, 2019

This comment has been minimized.

Copy link

@stamblerre stamblerre commented Jun 28, 2019

This should be resolved as of Closing.

@stamblerre stamblerre closed this Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.