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

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Make psql's qeury canceling test simple by using signal() routine of IPC::Run
Date: 2023-08-13 09:22:33
Message-ID: 92e71ed9-a970-3370-2abd-5c588ccd3786@mines-paristech.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Yugo-san,

> 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?

I'm the one who pointed out signal(), so I'm a little biaised,
nevertheless, regarding the patch:

Patch applies with "patch".

Test code is definitely much simpler.

Test run is ok on my Ubuntu laptop.

Let's drop 25 lines of perl!

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2023-08-13 09:27:55 Re: pgbench: allow to exit immediately when any client is aborted
Previous Message Michael Paquier 2023-08-13 08:39:34 Re: Ignore 2PC transaction GIDs in query jumbling