Fix process management
b6cf01a4 refactor: make path to std::process::exit shorter
This patch reduces the variable passing trace length. Instead of
returning it from function to function, call exit()
in place.
The trace of exit code before the patch:
std::process::exit() <- main <- main_run <- fork(child) <- tarantool_main
And now:
std::process::exit() <- tarantool_main
The type safety is ensured at compilation time by using !
type for
fn main()
. See https://doc.rust-lang.org/reference/types/never.html
5b5d25f3 Handle supervisor termination in child
Handle supervisor termination in child
We don't want a child process to live without the supervisor.
Usually, supervisor waits for child forever and retransmits termination signals. But if the parent is killed with a SIGKILL there's no way to pass anything.
This patch supplies a child process with a supervisor_fuse
fiber. It
tries to read from a pipe (that supervisor never writes to), and if the
writing end is closed, it means the supervisor has terminated. In this
case, child process terminates too.
Part of #56 (closed)
c3af1724 Forward signals from supervisor to child
That's it.
Close #56 (closed)