Skip to content

fix: kill Go server when Neovim terminates - #591

Merged
jakubbortlik merged 3 commits into
harrisoncramer:developfrom
jakubbortlik:fix/kill-the-server
Sep 23, 2026
Merged

jakubbortlik merged 3 commits into
harrisoncramer:developfrom
jakubbortlik:fix/kill-the-server

Conversation

@jakubbortlik

Copy link
Copy Markdown
Collaborator

This PR fixes part 2 of #583: Plugin leaves zombie processes of the Go server.

  1. A VimLeavePre autocmd is registered in lua/gitlab/server.lua that kills the server when Neovim terminates normally
  2. The vim.system call that starts the server now opens a pipe on the server's stdin. The server exits when it sees EOF on the pipe, which is how it notices that Neovim is gone in the cases the VimLeavePre autocmd cannot cover: SIGKILL, an OOM kill, or a crash.
  3. The gitlab.close_review function now has a default mapping glQ and accepts a shut_down_server parameter (default: true) that decides if the Go server should be killed when closing the review.

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
jakubbortlik merged commit 0af8e71 into harrisoncramer:develop Sep 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant