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

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Fri, 24 Dec 2021 08:46:42 +0000

  So indeed, when an exit signal was received at the same time stdin was
readable (unless your producer is spamming logs, that's a rare event,
which is why I never saw it), prepare_to_exit() was called but the
xindex0 marker was not updated and the remainder of the iteration still
called *handle_stdin, yielding read errors.

  Now, when handle_signals() calls prepare_to_exit(), the event loop
is restarted, so we're never handling events in an obsolete state.

  Please check the latest s6 git head and tell me if it works for you.

  The mistake of not restarting the event loop right away on state change
is something I became aware of and stopped making in later software, but
I never thought of going back and checking whether s6-log had it.
Thanks!

--
  Laurent
Received on Fri Dec 24 2021 - 09:46:42 CET

This archive was generated by hypermail 2.4.0 : Fri Dec 24 2021 - 09:47:12 CET