Normally I would just fix this bug, but given our proximity to the v0.12.0 release I'm filing it for later:
When state changes in gopls, we re-evaluate file watchers. Currently, this is done synchronously to the state change processing, via Server.didModifyFiles->updateWatchedDirectories.
Problems with this:
AFAIK there is no need to block change processing on updating watched directories. File watching is always going to be asynchronous, so I don't think we avoid any races by blocking while processing didChange notifications
we should generally avoid blocking on server->client calls during notification processing, as it can lead to distributed deadlocks in certain clients
we should awaitLoaded before re-evaluating file watches, as go list might surface new directories to watch after e.g. a go.mod change. We can't awaitLoaded during change processing.
The text was updated successfully, but these errors were encountered:
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 22, 2023
We don't actually watch replace targets anymore. The way to specify if a
module is being used is by including it in a go.work file.
Looking back on the flakiness, I am pretty sure it was due simply to
type-checking on slow builders, back when we limited each regtest to
20s. This module imports some standard library packages that used to be
slow to type check. I am pretty sure this test would no longer be flaky,
if we still supported the functionality.
While porting over the assertions from this test to TestUseGoWork, I
discovered golang/go#60340, a bug in the order of our file watcher
evaluation.
Fixesgolang/go#50748
Change-Id: I26c10ac659d0f195da18b6181b54d7c373cc984b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/496879
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Normally I would just fix this bug, but given our proximity to the v0.12.0 release I'm filing it for later:
When state changes in gopls, we re-evaluate file watchers. Currently, this is done synchronously to the state change processing, via
Server.didModifyFiles->updateWatchedDirectories
.Problems with this:
awaitLoaded
before re-evaluating file watches, asgo list
might surface new directories to watch after e.g. a go.mod change. We can'tawaitLoaded
during change processing.The text was updated successfully, but these errors were encountered: