pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Magnus Hagander <magnus@hagander.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add functions to wait for backend termination
Date: Thu, 08 Apr 2021 09:41:25 +0000
Message-ID: <E1lURAD-0007Kq-8D@gemulon.postgresql.org> (raw)

Add functions to wait for backend termination

This adds a function, pg_wait_for_backend_termination(), and a new
timeout argument to pg_terminate_backend(), which will wait for the
backend to actually terminate (with or without signaling it to do so
depending on which function is called). The default behaviour of
pg_terminate_backend() remains being timeout=0 which does not waiting.
For pg_wait_for_backend_termination() the default wait is 5 seconds.

Author: Bharath Rupireddy
Reviewed-By: Fujii Masao, David Johnston, Muhammad Usama,
             Hou Zhijie, Magnus Hagander
Discussion: https://postgr.es/m/CALj2ACUBpunmyhYZw-kXCYs5NM+h6oG_7Df_Tn4mLmmUQifkqA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/func.sgml                  |  30 +++++++-
doc/src/sgml/monitoring.sgml            |   4 ++
src/backend/catalog/system_views.sql    |  10 +++
src/backend/storage/ipc/signalfuncs.c   | 124 ++++++++++++++++++++++++++++++--
src/backend/utils/activity/wait_event.c |   3 +
src/include/catalog/pg_proc.dat         |   9 ++-
src/include/utils/wait_event.h          |   1 +
7 files changed, 174 insertions(+), 7 deletions(-)



Message-ID: <E1lURAD-0007Kq-8D@gemulon.postgresql.org>
Permalink:  ../E1lURAD-0007Kq-8D@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lURAD-0007Kq-8D@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: magnus@hagander.net
  Subject: Re: pgsql: Add functions to wait for backend termination
  In-Reply-To: <E1lURAD-0007Kq-8D@gemulon.postgresql.org>
  References: <E1lURAD-0007Kq-8D@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