x/tools/gopls: Shutdown does not interrupt current "work" #45476
Labels
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
A recent fix in
govim
means that when Vim shuts down, it triggers a shutdown sequence as follows::q
(or equivalent)govim
aVimLeave
event, which fires before exiting Vim, and blocks on the processing of this eventgovim
does some of its own tidy upgovim
calls thegopls.Shutdown
method, blocking on its returngovim
does some more tidying up before finally returning to VimVimLeave
event now processed, Vim exitsThis fix ensures that
govim
andgopls
properly tidy up (temporary files) after themselves.However, this appears to have highlighted an issue: that calling
Shutdown
does not interrupt existing "work" thatgopls
might be doing. Two things point to this being the case:Shutdown
call appears to be blocked whilst the package load is happening)As noted on Slack, in the case of the second issue there are many other issues at play, but it would still seem, like in the first case, desirable for
Shutdown
to be able to interrupt anything thatgopls
is doing.For now we have a workaround in
govim
, to set a deadline of 500ms for theShutdown
call to be processed. The impact of this being that if the call toShutdown
exceed the deadline,gopls
' temporary files (and other things?) are not tidied up.What did you expect to see?
Shutdown
being handled immediately, and not blocking on current "work".What did you see instead?
As above.
cc @stamblerre
FYI @leitzler @mvdan
The text was updated successfully, but these errors were encountered: