Add functions to wait for backend termination

Magnus Hagander <magnus@hagander.net>

Commit: aaf043257205ec523f1ba09a3856464d17cf2281
Author: Magnus Hagander <magnus@hagander.net>
Date: 2021-04-08T09:40:54Z
Releases: 14.0
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

Files

Documentation touched

Discussion