1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:24:48 -07:00
go/internal/lsp/lsprpc
Rob Findley d1d1f200c6 internal/lsp/lsprpc: use Setsid on POSIX GOOSes, to avoid SIGTERMs
When the gopls daemon is automatically managed (-remote=auto), it will
be started by one of the forwarder gopls processes that was in turn
started by the editor. By default, this puts it in the same process
group as the forwarder gopls.

Some editors (at least Vim) send SIGTERM to the process groups of
sidecar processes when exiting. This can cause the gopls daemon to
terminate, thereby losing state.

Rather than ignore SIGTERM (which is bound to be editor dependent
anyway), let's just put the gopls daemon in a separate session.

Updates golang/go#34111

Change-Id: I71386fb54b8c2efe1c565f59763f46693a7d48b0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/221220
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-03-05 21:44:44 +00:00
..
autostart_default.go internal/lsp/lsprpc: use Setsid on POSIX GOOSes, to avoid SIGTERMs 2020-03-05 21:44:44 +00:00
autostart_posix.go internal/lsp/lsprpc: use Setsid on POSIX GOOSes, to avoid SIGTERMs 2020-03-05 21:44:44 +00:00
lsprpc_test.go internal/lsp: move the debug.Instance onto the Context 2020-03-03 22:54:53 +00:00
lsprpc.go internal/lsp/lsprpc: use Setsid on POSIX GOOSes, to avoid SIGTERMs 2020-03-05 21:44:44 +00:00
telemetry.go internal/lsp: refactor LSP server instantiation 2020-02-06 23:12:37 +00:00