1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:44:42 -07:00
go/internal/lsp/cache
Muir Manders e54115a062 internal/lsp: fix stuck diagnostic messages
The "analyses" cache in lsp/cache.(*Package).GetActionGraph was not
getting cleared on errors. This could result in future calls to
GetActionGraph waiting on the "ready" channel indefinitely. This in
turn caused the goroutine in cacheAndDiagnose to block indefinitely
and never send the diagnostic results back.

Now we use a defer statement to always close the channel. If we did
not succeed, we also clear out the cache entry and set a "succeeded =
false" flag to signal waiters that they need to retry. If in the
future errors other than context.Canceled/Timeout are possible, this
retry behavior may need to be revisited.

Fixes golang/go#30786

Change-Id: Icacc9188f1500b00f2178521ce373a2c1363f932
GitHub-Last-Rev: 7c43afd4286a69b0d35a625716e6934c72c4cef5
GitHub-Pull-Request: golang/tools#91
Reviewed-on: https://go-review.googlesource.com/c/tools/+/173977
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
2019-04-25 21:19:06 +00:00
..
check.go internal/lsp: return errors when we can't find a package 2019-04-25 18:52:35 +00:00
file.go internal/lsp: return errors when we can't find a package 2019-04-25 18:52:35 +00:00
parse.go internal/lsp: handle completion after defer, go statements 2019-04-24 22:01:01 +00:00
pkg.go internal/lsp: fix stuck diagnostic messages 2019-04-25 21:19:06 +00:00
view.go internal/lsp: avoid extra work in *cache.View.remove 2019-04-01 20:55:34 +00:00