fix: kill Go server when Neovim terminates - #591
Merged
jakubbortlik merged 3 commits intoSep 23, 2026
Merged
Conversation
jakubbortlik
force-pushed
the
fix/kill-the-server
branch
from
September 22, 2026 07:43
c0339af to
e1ee27e
Compare
The `gitlab.close_review` function now takes an optional `shut_down_server` parameter (Boolean, `true` by default) which can be used to specify if the Go server should be shut down when closing the review.
A VimLeavePre autocmd is registered that kills the server when Neovim is terminating.
The plugin now opens a pipe on the server's stdin which let's the server notice that the parent Neovim process is gone and exit in cases that are not covered by the VimLeavePre autocmd which shuts down the server when Neovim terminates normally.
jakubbortlik
force-pushed
the
fix/kill-the-server
branch
from
September 23, 2026 11:26
e1ee27e to
307069f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes part 2 of #583: Plugin leaves zombie processes of the Go server.
VimLeavePreautocmd is registered inlua/gitlab/server.luathat kills the server when Neovim terminates normallyvim.systemcall that starts the server now opens a pipe on the server'sstdin. The server exits when it sees EOF on the pipe, which is how it notices that Neovim is gone in the cases theVimLeavePreautocmd cannot cover: SIGKILL, an OOM kill, or a crash.gitlab.close_reviewfunction now has a default mappingglQand accepts ashut_down_serverparameter (default:true) that decides if the Go server should be killed when closing the review.