pgsql: Handle EACCES errors from kevent() better.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Handle EACCES errors from kevent() better.
Date: 2020-10-15 05:40:20
Message-ID: E1kSvzw-0006cy-8X@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Handle EACCES errors from kevent() better.

While registering for postmaster exit events, we have to handle a couple
of edge cases where the postmaster is already gone. Commit 815c2f09
missed one: EACCES must surely imply that PostmasterPid no longer
belongs to our postmaster process (or alternatively an unexpected
permissions model has been imposed on us). Like ESRCH, this should be
treated as a WL_POSTMASTER_DEATH event, rather than being raised with
ereport().

No known problems reported in the wild. Per code review from Tom Lane.
Back-patch to 13.

Reported-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/3624029.1602701929%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/70516a178ad0fc54d0f0d2a88175af3e1e92f83f

Modified Files
--------------
src/backend/storage/ipc/latch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2020-10-15 05:40:34 pgsql: Handle EACCES errors from kevent() better.
Previous Message Amit Kapila 2020-10-15 02:57:15 pgsql: Execute invalidation messages for each XLOG_XACT_INVALIDATIONS m