Skip to content

Commit

Permalink
gopls/internal/lsp/cache: suppress panics during analysis
Browse files Browse the repository at this point in the history
We now have a plausible model for the cause of the analysis
crashes and are disabling this check until we have submitted
a plausible fix.

(Specifically: actionHandle.promise may be a stale promise
for an older package with the same ID, since snapshot.actions
uses the package ID as a key. This causes us to re-use
stale inspectors, whose syntax nodes won't be found in TypesInfo.)

Updates golang/go#54762
Updates golang/go#56035

Change-Id: I1a7cc1b02b8c322692b1a6bee03f6cd858c08ea0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/440179
TryBot-Result: Gopher Robot <[email protected]>
gopls-CI: kokoro <[email protected]>
Run-TryBot: Alan Donovan <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Auto-Submit: Alan Donovan <[email protected]>
  • Loading branch information
adonovan authored and gopherbot committed Oct 7, 2022
1 parent 20c1ee7 commit 8b1d1ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gopls/internal/lsp/cache/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ func actionImpl(ctx context.Context, snapshot *snapshot, deps []*actionHandle, a
if r := recover(); r != nil {
// An Analyzer crashed. This is often merely a symptom
// of a problem in package loading.
if bug.PanicOnBugs && analyzer.Name != "fact_purity" {
// Now that we have a theory of these crashes,
// we disable the check to stop flakes from being a nuisance.
// TODO(adonovan): re-enable it when plausibly fixed.
const strict = false
if strict && bug.PanicOnBugs && analyzer.Name != "fact_purity" {
// During testing, crash. See issues 54762, 56035.
// But ignore analyzers with known crash bugs:
// - fact_purity (dominikh/go-tools#1327)
Expand Down

0 comments on commit 8b1d1ec

Please sign in to comment.