Skip to content

Conversation

@ArneSchulze
Copy link

The default behaviour of ocaml when receiving a SIGPIPE signal is to terminate the program. Processes opened in Commands.re it can exit prematurely causing an EPIPE error which triggers the SIGPIPE signal leading the language server process to terminate. To circumvent that we tell OCaml to ignore SIGPIPE s.t. the error can be handled when interacting with the channels/file-descriptors in Commands.

| None => ()
| Some(text) => output_string(cmd_in, text)
};
close_out(cmd_in);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close_out would trigger a Sys_error("Broken pipe") exception now that we ignore the SIGPIPE signal. Instead of catching and handling it, we simply use close_out_noerr which ignores all errors

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