Alexander Kuzmenkov <[email protected]> writes:
> I noticed that sometimes, when I'm running the regression tests and a
> backend crashes, the postmaster can get stuck in some weird state
> where it doesn't terminate and doesn't respond to `pg_ctl stop`
> anymore. I can semi-reliably reproduce this on 18.3 using a simple
> script below.
I experimented with this a bit. I failed to reproduce it with
your example, but it did happen once I reduced the "sleep 0.01"
to "sleep 0.001". So apparently, the postmaster misbehaves if
the stop signal arrives soon enough after a child crash (and
the window is tight enough that it's not too surprising we
hadn't noticed). Didn't look at the logic.
regards, tom lane