> 28 авг. 2021 г., в 07:05, Andres Freund <andres@anarazel.de> написал(а):
>
> However, we have a
> bandaid that deals with possible hangs, by SIGKILLing when processes don't
> shut down (at that point things have already gone quite south, so that's not
> an issue).
Thanks for the explanation. I can see that child process SIGKILL machinery was introduced by
82233ce7ea42d6ba519aaec63008aff49da6c7afcommit to fix a malloc() deadlock in quickdie() signal handler. As a result,
allchild processes that die too long are killed in the ServerLoop() with SIGKILL. But bgworker_die() is a problem as we
initializebgworkers right before ServerLoop(). So we can face malloc() deadlock on postmaster startup (before
ServerLoop()started). Maybe we should simply use write() and exit() instead of ereport() for bgworker_die()?
Best regards,
Denis Smirnov | Developer
sd@arenadata.io
Arenadata | Godovikova 9-17, Moscow 129085 Russia