mirror of https://github.com/golang/go.git
The 'go' command reads the main module's 'go.mod' file with the file locked. If 'gopls' starts a 'go' command in the background that reads the 'go.mod' file, there is a narrow window in which that read can race with the test's ioutil.WriteFile. This change retries the write (as a user would probably do), fixing the test failure. However, I suspect that there may be a broader UX issue here that it will mask: in order to actually avoid the race without a locking error, something in the LSP protocol needs to be synchronizing gopls-initiated reads with editor-initiated writes. The test failure this fixes indicates that that synchronization seems not to be happening. Fixes golang/go#50971 Change-Id: Iba140277bf957bae4937cc23f62d3aac817a7d36 Reviewed-on: https://go-review.googlesource.com/c/tools/+/382414 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> |
||
|---|---|---|
| .. | ||
| analysisinternal | ||
| apidiff | ||
| event | ||
| fakenet | ||
| fastwalk | ||
| gocommand | ||
| gopathwalk | ||
| imports | ||
| jsonrpc2 | ||
| jsonrpc2_v2 | ||
| lsp | ||
| memoize | ||
| mod | ||
| packagesinternal | ||
| proxydir | ||
| span | ||
| stack | ||
| testenv | ||
| tool | ||
| typeparams | ||
| typesinternal | ||
| xcontext | ||