pgsql: Use standard SIGTERM signal handler die() in test_shm_mq worker.

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема pgsql: Use standard SIGTERM signal handler die() in test_shm_mq worker.
Дата
Msg-id E1kiXWW-0008Le-Lj@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Use standard SIGTERM signal handler die() in test_shm_mq worker.

Previously test_shm_mq worker used the stripped-down version of die()
as the SIGTERM signal handler. This commit makes it use die(), instead,
to simplify the code.

In terms of the code, the difference between die() and the stripped-down
version previously used is whether the signal handler directly may call
ProcessInterrupts() or not. But this difference doesn't exist in
a background worker because, in bgworker, DoingCommandRead flag will
never be true and die() will never call ProcessInterrupts() directly.
Therefore test_shm_mq worker can safely use die(), like other bgworker
proceses (e.g., logical replication apply launcher or autoprewarm worker)
currently do.

Thanks to Craig Ringer for the report and investigation of the issue.

Author: Bharath Rupireddy
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/CAGRY4nxsAe_1k_9g5b47orA0S011iBoHsXHFMH7cg7HV0O1bwQ@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/test/modules/test_shm_mq/worker.c | 28 +++-------------------------
1 file changed, 3 insertions(+), 25 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Fujii Masao
Дата:
Сообщение: pgsql: Use standard SIGHUP and SIGTERM signal handlers in worker_spi.
Следующее
От: Fujii Masao
Дата:
Сообщение: pgsql: Fix CLUSTER progress reporting of number of blocks scanned.