• Tom Lane's avatar
    In immediate shutdown, postmaster should not exit till children are gone. · 48913db8
    Tom Lane authored
    This adjusts commit 82233ce7 so that the
    postmaster does not exit until all its child processes have exited, even
    if the 5-second timeout elapses and we have to send SIGKILL.  There is no
    great value in having the postmaster process quit sooner, and doing so can
    mislead onlookers into thinking that the cluster is fully terminated when
    actually some child processes still survive.
    
    This effect might explain recent test failures on buildfarm member hamster,
    wherein we failed to restart a cluster just after shutting it down with
    "pg_ctl stop -m immediate".
    
    I also did a bit of code review/beautification, including fixing a faulty
    use of the Max() macro on a volatile expression.
    
    Back-patch to 9.4.  In older branches, the postmaster never waited for
    children to exit during immediate shutdowns, and changing that would be
    too much of a behavioral change.
    48913db8
postmaster.c 168 KB