1
0
mirror of https://github.com/golang/go synced 2024-10-01 05:28:33 -06:00
go/internal
Rebecca Stambler db903f390e internal/lsp: fix concurrent map write in file invalidation
The invalidateContent function does not acquire a snapshot's mutex to
avoid blocking other work (even though it probably should since it's
only called after a context is canceled). A case was added to iterate
through files when a file is created, and it did not respect the fact
that the snapshot's mutex was not locked, resulting in a concurrent map
read and write. This change makes sure that the access of the snapshot's
files map is guarded by a mutex.

As a follow-up, we should just acquire snapshot.mu in invalidateContent.

Updates golang/go#36006

Change-Id: Idd904ae582055ce786062df50875ac7f0896fd1c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210199
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2019-12-06 18:53:04 +00:00
..
apidiff all: fix more typos 2019-09-11 15:13:14 +00:00
fastwalk internal/fastwalk: avoid slice bounds out of range for long file names 2018-11-12 23:16:31 +00:00
gopathwalk internal/imports: cache things outside the mod cache 2019-10-21 20:45:41 +00:00
imports internal/imports: make ApplyFixes work despite syntax errors 2019-12-02 20:30:33 +00:00
jsonrpc2 internal/lsp: cancel early 2019-10-22 07:49:31 +00:00
lsp internal/lsp: fix concurrent map write in file invalidation 2019-12-06 18:53:04 +00:00
memoize internal/memoize: fix race on read of handle.function 2019-12-05 18:38:34 +00:00
module imports: stop using go/packages for modules 2019-01-22 20:29:12 +00:00
semver go/packages: add name= query 2018-10-16 20:20:09 +00:00
span internal/span: support line directives 2019-11-25 19:20:43 +00:00
telemetry internal/telemetry: lift the tests up to the request level 2019-11-27 15:41:43 +00:00
testenv internal/testenv: reject the resolved 'go' command if it does not match runtime.GOROOT 2019-11-11 19:22:22 +00:00
tool tools/internal/tool: refactor tool.Main() for testabilty 2019-09-19 22:27:22 +00:00
xcontext internal/lsp: stop making background contexts everywhere 2019-07-11 16:38:52 +00:00