Skip to content

Commit

Permalink
fix: use sigterm instead of sigkill/sigint
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

<!-- ps-id: 46f9a999-c9d1-4d96-8b1e-833c5c10e940 -->
  • Loading branch information
rgrinberg committed Jul 13, 2024
1 parent 0c7be13 commit 2f647f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Unreelased

## Fixes

- Kill unnecessary ocamlformat processes with sigterm rather than sigint or
sigkill (#1343)

# 1.18.0

## Features
Expand Down
2 changes: 1 addition & 1 deletion ocaml-lsp-server/src/ocamlformat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let run_command cancel prog stdin_value args =
res, Fiber.Cancel.Not_cancelled
| Some token ->
let on_cancel () =
Unix.kill (Pid.to_int pid) Sys.sigint;
Unix.kill (Pid.to_int pid) Sys.sigterm;
Fiber.return ()
in
fun f -> Fiber.Cancel.with_handler token ~on_cancel f
Expand Down
2 changes: 1 addition & 1 deletion ocaml-lsp-server/src/ocamlformat_rpc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ end = struct
| Error (`Msg msg) ->
(* The process did start but something went wrong when negociating the
version so we need to kill it *)
Unix.kill pid Sys.sigkill;
Unix.kill pid Sys.sigterm;
let* () =
let message =
Printf.sprintf
Expand Down

0 comments on commit 2f647f1

Please sign in to comment.