Re: kevent latch paths don't handle postmaster death well

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: kevent latch paths don't handle postmaster death well
Date: 2020-10-14 22:10:28
Message-ID: CA+hUKGJ8aHjyxccsn3z4NOpnWBdfUSmzVPm6uc_B63ODnQvvPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 15, 2020 at 8:40 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> > The process exit event is like an 'edge', not a 'level'... hmm. It
> > might be enough to set report_postmaster_not_running = true the first
> > time it tells us so if we try to wait again we'll treat it like a
> > level. I will look into it later today.
>
> Seems like having that be per-WaitEventSet state is also not a great
> idea --- if we detect PM death while waiting on one WES, and then
> wait on another one, it won't work. A plain process-wide static
> variable would be a better way I bet.

I don't think that's a problem -- the kernel will report the event to
each interested kqueue object. The attached fixes the problem for me.

Attachment Content-Type Size
0001-Make-WL_POSTMASTER_DEATH-level-triggered-on-kqueue-b.patch text/x-patch 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-10-14 22:18:53 Re: kevent latch paths don't handle postmaster death well
Previous Message Andres Freund 2020-10-14 21:58:35 Re: gs_group_1 crashing on 13beta2/s390x