Re: Unsightly errors due to race on closing stdin when handling signals in s6-log

From: Earl Chew <earl_chew_at_yahoo.com>
Date: Thu, 23 Dec 2021 11:44:33 -0800

Laurent,

> I don't like opening anything (even /dev/null) on an exit path

Though I was looking to keep the scope of my efforts limited, I think
this would be preferred if you an achieve it.

Earl


On , Laurent Bercot wrote:
>> IIRC the use case involves signal handling, which causes
>> prepare_to_exit() to be called in handle_signals(). Once the signal
>> handler returns, stdin is closed. The mainline continues to refer to
>> the now closed file descriptor, and emits errors as consequence. The
>> process terminates, but the path to exit is unsightly.
>
>  Ah, good catch. Thanks for the report and the patch!
>  I don't like opening anything (even /dev/null) on an exit path, so
> I'll try to fix the problem in another way (tracking use of fd 0 in
> the mainline) over the next few days. If it proves too difficult, I'll
> commit something similar to your patch.
>
> --
>  Laurent
>
Received on Thu Dec 23 2021 - 20:44:33 CET

This archive was generated by hypermail 2.4.0 : Thu Dec 23 2021 - 20:45:15 CET