Make psql's qeury canceling test simple by using signal() routine of IPC::Run

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Make psql's qeury canceling test simple by using signal() routine of IPC::Run
Date: 2023-08-10 03:59:35
Message-ID: 20230810125935.22c2922ea5250ba79358965b@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Currently, the psql's test of query cancelling (src/bin/psql/t/020_cancel.pl)
gets the PPID of a running psql by using "\!" meta command, and sends SIGINT to
the process by using "kill". However, IPC::Run provides signal() routine that
sends a signal to a running process, so I think we can rewrite the test using
this routine to more simple fashion as attached patch.

What do you think about it?

Use of signal() is suggested by Fabien COELHO during the discussion of
query cancelling of pgbench [1].

[1] https://www.postgresql.org/message-id/7691ade8-78-dd4-e26-135ccfbf0e9%40mines-paristech.fr

Regards,
Yugo Nagata

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
simple_psql_cancel_test.patch text/x-diff 1.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiro Ikeda 2023-08-10 04:08:39 Re: Support to define custom wait events for extensions
Previous Message Amit Kapila 2023-08-10 03:52:40 Re: [PoC] pg_upgrade: allow to upgrade publisher node