go/internal/lsp/debug
Rob Findley 6397a11608 internal/lsp/debug: splice in updated servers rather than overwrite
Updating server info was racing with rendering debug templates, because
the state mutex only guards the servers slice, not the values contained
in that slice.

Switch to splicing in updated server data, rather than updating
in-place, to avoid the race.

Change-Id: Ia69895b49cf3f961c58db8e6512ce8b1f5911fd3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/314169
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2021-04-27 15:36:10 +00:00
..
log internal/lsp/debug: hook runtime/trace into event spans 2020-12-11 18:50:31 +00:00
tag internal/lsp/cache: fix some package event tags 2020-12-23 20:03:49 +00:00
info.go internal/lsp: add a command to start the debug server 2021-04-26 15:43:18 +00:00
metrics.go internal/event: move event/core.Tag to event/label.Label 2020-04-23 18:13:33 +00:00
rpc.go gopls/test: add type checking for debug server templates 2020-12-22 16:32:15 +00:00
serve.go internal/lsp/debug: splice in updated servers rather than overwrite 2021-04-27 15:36:10 +00:00
trace.go gopls/test: add type checking for debug server templates 2020-12-22 16:32:15 +00:00