LanguageClient.stop hangs indefinitely if the language server
fails to respond to the `shutdown` request. For example, in
go.dev/issues/52543 we observed `gopls` crashes during
shutdown.
Implement a timeout from our side. (2sec)
Caveat:
If gopls is still active but fails to respond within 2sec,
it's possible that we may end up having multiple
gopls instances briefly until the previous gopls completes
the shutdown process.
For golang/vscode-go#1896
For golang/vscode-go#2222
Change-Id: Idbcfd3ee5f94fd3fd8dcafa228c6f03f5e14b905
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/402834
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
Reviewed-by: Jamal Carvalho <[email protected]>
(cherry picked from commit 9227019e7eca3691665e8c6a15b8cf332febdcf3)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/403414