Make data checksums launcher cancel its worker at SIGINT

Make sure the launcher cancels the currently running worker by calling
TerminateBackgroundWorker when it receives SIGINT.  In order to handle
cases where SIGINT arrives while tje launcher is waiting for a worker
to start or exit, implement a version of WaitForBackgroundWorkerStartup
and WaitForBackgroundWorkerShutdown which checks the abort_requested
signalling.  A new test which kills processing with SIGINT is added.

Backpatch to v19 where online checksums were introduced.

Author: Fujii Masao <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Discussion: 
https://postgr.es/m/cahgqgweq1-+ipqnuptxyihmzsz9uffvkok4kl_uytdyt7jg...@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3a18526e8d6bcdd25db847128dd83bb4c1ba6ec2

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c       | 112 +++++++++++++++++++---
src/test/modules/test_checksums/t/002_restarts.pl |  42 ++++++++
2 files changed, 143 insertions(+), 11 deletions(-)

Reply via email to