pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Use signals for postmaster death on FreeBSD.
4+ messages / 3 participants
[nested] [flat]

* pgsql: Use signals for postmaster death on FreeBSD.
@ 2018-07-11 01:14  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Munro @ 2018-07-11 01:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use signals for postmaster death on FreeBSD.

Use FreeBSD 11.2's new support for detecting parent process death to
make PostmasterIsAlive() very cheap, as was done for Linux in an
earlier commit.

Author: Thomas Munro
Discussion: https://postgr.es/m/7261eb39-0369-f2f4-1bb5-62f3b6083b5e@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f98b8476cd4a19dfc602ab95642ce08e53877d65

Modified Files
--------------
configure                          | 2 +-
configure.in                       | 2 +-
src/backend/storage/ipc/pmsignal.c | 3 +++
src/include/pg_config.h.in         | 3 +++
src/include/storage/pmsignal.h     | 7 ++++++-
5 files changed, 14 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Use signals for postmaster death on Linux.
@ 2018-07-11 01:14  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Thomas Munro @ 2018-07-11 01:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use signals for postmaster death on Linux.

Linux provides a way to ask for a signal when your parent process dies.
Use that to make PostmasterIsAlive() very cheap.

Based on a suggestion from Andres Freund.

Author: Thomas Munro, Heikki Linnakangas
Reviewed-By: Michael Paquier
Discussion: https://postgr.es/m/7261eb39-0369-f2f4-1bb5-62f3b6083b5e%40iki.fi
Discussion: https://postgr.es/m/20180411002643.6buofht4ranhei7k%40alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9f09529952ac41a10e5874cba745c1c24e67ac79

Modified Files
--------------
configure                          |   2 +-
configure.in                       |   2 +-
src/backend/storage/ipc/latch.c    |   6 +-
src/backend/storage/ipc/pmsignal.c | 125 +++++++++++++++++++++++++++++++++----
src/backend/utils/init/miscinit.c  |   4 ++
src/include/pg_config.h.in         |   3 +
src/include/pg_config.h.win32      |   3 +
src/include/storage/pmsignal.h     |  33 +++++++++-
8 files changed, 159 insertions(+), 19 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: Use signals for postmaster death on Linux.
@ 2018-08-01 20:07  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Thomas Munro <tmunro@postgresql.org>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2018-08-01 20:07 UTC (permalink / raw)
  To: Thomas Munro <tmunro@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Thomas Munro <tmunro@postgresql.org> writes:
> Use signals for postmaster death on Linux.

One or the other of these patches seems to have caused pmsignal.h
to fail to compile standalone:

./src/include/storage/pmsignal.h:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'postmaster_possibly_dead'
./src/include/storage/pmsignal.h: In function 'PostmasterIsAlive':
./src/include/storage/pmsignal.h:84: error: 'postmaster_possibly_dead' undeclared (first use in this function)
./src/include/storage/pmsignal.h:84: error: (Each undeclared identifier is reported only once
./src/include/storage/pmsignal.h:84: error: for each function it appears in.)

Apparently, this header needs a reference to wherever sig_atomic_t
is declared.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: Use signals for postmaster death on Linux.
@ 2018-08-01 22:41  Thomas Munro <thomas.munro@enterprisedb.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Munro @ 2018-08-01 22:41 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Munro <tmunro@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, Aug 2, 2018 at 8:07 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <tmunro@postgresql.org> writes:
>> Use signals for postmaster death on Linux.
>
> One or the other of these patches seems to have caused pmsignal.h
> to fail to compile standalone:
>
> ./src/include/storage/pmsignal.h:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'postmaster_possibly_dead'
> ./src/include/storage/pmsignal.h: In function 'PostmasterIsAlive':
> ./src/include/storage/pmsignal.h:84: error: 'postmaster_possibly_dead' undeclared (first use in this function)
> ./src/include/storage/pmsignal.h:84: error: (Each undeclared identifier is reported only once
> ./src/include/storage/pmsignal.h:84: error: for each function it appears in.)
>
> Apparently, this header needs a reference to wherever sig_atomic_t
> is declared.

Thanks, will fix.

-- 
Thomas Munro
http://www.enterprisedb.com




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-08-01 22:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 01:14 pgsql: Use signals for postmaster death on Linux. Thomas Munro <tmunro@postgresql.org>
2018-08-01 20:07 ` Re: pgsql: Use signals for postmaster death on Linux. Tom Lane <tgl@sss.pgh.pa.us>
2018-08-01 22:41   ` Re: pgsql: Use signals for postmaster death on Linux. Thomas Munro <thomas.munro@enterprisedb.com>
2018-07-11 01:14 pgsql: Use signals for postmaster death on FreeBSD. Thomas Munro <tmunro@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox