[tarantool-patches] Re: [PATCH 1/1] app: exit gracefully when a main script throws an error

Kirill Yukhin kyukhin at tarantool.org
Tue Oct 1 11:38:25 MSK 2019


Hello,

On 11 сен 00:00, Vladislav Shpilevoy wrote:
> Code to run main script (passed via command line args, or
> interactive console) has a footer where it notifies systemd,
> logs a happened error, and panics.
> 
> Before the patch that code was unreachable in case of any
> exception in a main script, because panic happened earlier. Now a
> happened exception is correctly carried to the footer with proper
> error processing.
> 
> A first and obvious solution was replace all panics with diag_set
> and use fiber_join on the script runner fiber. But appeared, that
> the fiber running a main script can't be joined. This is because
> normally it exits via os.exit() which never returns and therefore
> its caller never dies = can't be joined.
> 
> The patch solves this problem by passing main fiber diag to the
> script runner by pointer, eliminating fiber_join necessity.
> 
> Closes #4382
> ---
> Branch: https://github.com/tarantool/tarantool/tree/gerold103/gh-4382-init-script-fail-and-sysd
> Issue: https://github.com/tarantool/tarantool/issues/4382

LGTM. I've checked yout patch into 1.10, 2.1, 2.2 and master.

--
Regards, Kirill Yukhin




More information about the Tarantool-patches mailing list