On Sun, Aug 7, 2022 at 10:42 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@gmail.com> writes:
> > Did I understand correctly that the places that do kill(-pid) followed
> > by kill(pid) really only need the kill(-pid)?
>
> Uh ... did you read the comment right above signal_child?
>
> * There is a race condition for recently-forked children: they might not
> * have executed setsid() yet. So we signal the child directly as well as
> * the group. We assume such a child will handle the signal before trying
> * to spawn any grandchild processes. We also assume that signaling the
> * child twice will not cause any problems.
Oof. Fixed.