On 2026-May-26, Euler Taveira wrote: > It fixes the issue for me. However, I'm wondering if we can avoid adding a new > boolean for it. We already have redirection_done that guarantees the syslogger > is working properly.
Yeah, that was my first thought as well, but after looking at it, I thought it may be better not to mess with that, since it was almost surgical in how it was designed; furthermore, it is written to be transmitted from postmaster to its children, whereas this new state variable is local to the syslogger process. Also, consider the case where you have postmaster running for a while (so redirection_done has been set already), and for whatever reason syslogger restarts. Will it inherit the correct value? I don't know (I think it won't), and it seems error-prone to assume it will work correctly. I think this would only fail if for whatever reason the syslogger itself wanted to print an error before setting up the file descriptors, but I don't think this is impossible: for example, if postmaster_child_launch() runs into an OOM during internal_forkexec(). Plus, redirection_done means something completely different: it is used to say that syslogPipe[] has been set up for message chunk transmission. The new variable indicates that the logging file descriptors for the various output files (syslogFile etc) have been set up in the syslogger process. All in all, I don't think we should cut corners here just to save one boolean variable. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "No hay ausente sin culpa ni presente sin disculpa" (Prov. francés)
