Re: Make pgbench exit on SIGINT more reliably - Mailing list pgsql-hackers

From Tristan Partin
Subject Re: Make pgbench exit on SIGINT more reliably
Date
Msg-id CTZFJLBHY4DU.Z38WPJQ9MDUC@gonk
Whole thread Raw
In response to Re: Make pgbench exit on SIGINT more reliably  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Mon Jul 10, 2023 at 10:29 PM CDT, Michael Paquier wrote:
> On Tue, Jun 27, 2023 at 09:42:05AM -0500, Tristan Partin wrote:
> > I would say there probably isn't much benefit if you think the polling
> > for CancelRequested is fine. Looking at the other patch, I think it
> > might be simple to add an exit code for SIGINT. But I think it might be
> > best to do it after that patch is merged. I added the other patch to the
> > commitfest for July. Holding off on this one.
>
> Okay, I am going to jump on the patch to switch to COPY, then.

After looking at the other patch some more, I don't think there is a
good way to reliably exit from SIGINT. The only time pgbench ever polls
for CancelRequested is in initPopulateTable(). So if you hit CTRL+C at
any time during the execution of the other initalization steps, you're
out of luck. The default initialization steps are dtgvp, so after g we
have vacuuming and primary keys. From what I can tell pgbench will
continue to run these steps even after it has received a SIGINT.

This behavior seems unintended and odd to me. Though, maybe I am missing
something.

--
Tristan Partin
Neon (https://neon.tech)



pgsql-hackers by date:

Previous
From: "Tristan Partin"
Date:
Subject: Re: Use COPY for populating all pgbench tables
Next
From: Ashutosh Bapat
Date:
Subject: Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes