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: CLI: gopls check go.mod hangs #46251

Closed
findleyr opened this issue May 19, 2021 · 3 comments
Closed

x/tools/gopls: CLI: gopls check go.mod hangs #46251

findleyr opened this issue May 19, 2021 · 3 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

The gopls command line can check go files with gopls check foo.go, and should theoretically be able to also check modfiles. However, gopls check go.mod just hangs indefinitely.

We should either add support for checking modfiles, or return a meaningful error.

CC @stamblerre

@findleyr findleyr added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 19, 2021
@findleyr findleyr added this to the gopls/unplanned milestone May 19, 2021
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 19, 2021
@KarthikNayak
Copy link
Contributor

KarthikNayak commented Jun 17, 2021

Interesting! @stamblerre can I pick this up?

Update: could reproduce it on latest tip.

KarthikNayak added a commit to KarthikNayak/tools that referenced this issue Jun 17, 2021
In `internal/lsp/cmd.(*connection).diagnoseFiles`, when we request for
`gopls/diagnoseFiles`, we are blocked on the channel even if there is an error.
In such a scenario, we've reach a deadlock since. Avoid this by checking for
error, existing if it exists and also closing the channel while we're at it.

Fixes golang/go#46251

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
@KarthikNayak
Copy link
Contributor

I actually went ahead and created a PR, but I need help writing tests, can someone point to where the tests for this section of the code lie?

@gopherbot
Copy link

Change https://golang.org/cl/329109 mentions this issue: internal/lsp: do not block on channel when there is an error

@golang golang locked and limited conversation to collaborators Jun 21, 2022
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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants