pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Handle SIGTERM in pg_receivewal and pg_recvlogical
Date: Wed, 14 Sep 2022 14:35:40 +0000
Message-ID: <E1oYTUJ-000JsF-OM@gemulon.postgresql.org> (raw)

Handle SIGTERM in pg_receivewal and pg_recvlogical

In pg_receivewal, compressed output is only flushed on clean exits.  The
reason to support SIGTERM as well as SIGINT (which is currently handled)
is that pg_receivewal might well be running as a daemon, and systemd's
default KillSignal is SIGTERM.

Since pg_recvlogical is also supposed to run as a daemon, teach it about
SIGTERM as well and update the documentation to match.  While in there,
change pg_receivewal's time_to_stop to be sig_atomic_t like it is in
pg_recvlogical.

Author: Christoph Berg <myon@debian.org>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/Yvo/5No5S0c4EFMj@msg.df7cb.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8b60db774356117fab2eb53fb37160fa3e173cdb

Modified Files
--------------
doc/src/sgml/ref/pg_receivewal.sgml    |  8 +++++---
doc/src/sgml/ref/pg_recvlogical.sgml   | 18 ++++++++++++++++++
src/bin/pg_basebackup/pg_receivewal.c  | 11 ++++++-----
src/bin/pg_basebackup/pg_recvlogical.c |  9 +++++----
4 files changed, 34 insertions(+), 12 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1oYTUJ-000JsF-OM@gemulon.postgresql.org>
Permalink:  ../E1oYTUJ-000JsF-OM@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oYTUJ-000JsF-OM@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org
  Subject: Re: pgsql: Handle SIGTERM in pg_receivewal and pg_recvlogical
  In-Reply-To: <E1oYTUJ-000JsF-OM@gemulon.postgresql.org>
  References: <E1oYTUJ-000JsF-OM@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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