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

2021-12-24 Thread Laurent Bercot
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_

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

2021-12-24 Thread Earl Chew via skaware
Laurent, Thanks for the quick turnaround. Let's see if I understand. The key part is here:   case SIGTERM :     if (flagprotect) break ;   case SIGHUP :     handle_stdin = &last_stdin ;     if (!indata.len) { prepare_to_exit() ; e = 1 ; }     break ; The risk is that l

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

2021-12-24 Thread Laurent Bercot
Laurent, Thanks for the quick turnaround. Let's see if I understand. The key part is here: case SIGTERM : if (flagprotect) break ; case SIGHUP : handle_stdin = &last_stdin ; if (!indata.len) { prepare_to_exit() ; e = 1 ; } break ; The risk is that