Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/lsp/cache: fail workspace load on context cancellation
If the context was cancelled early during initialization, it was possible that all module load scopes get skipped, because ParseMod returns the context error. As a result, the subsequent load would succeed trivially, even though the context was cancelled. After analyzing the reinitialization codepath, it seems very plausible to encounter this race, and it explains the flakiness of TestReinitializeRepeatedly -- I have found nothing else that would explain the failure mode observed in logs, that the reload bypasses initialization. Fix this by returning when context errors are encountered. Fixes golang/go#57780 Change-Id: I3fb971503f280131c59146bc586da45dd2ed1126 Reviewed-on: https://go-review.googlesource.com/c/tools/+/495058 gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Findley <rfindley@google.com>
- Loading branch information