Re: Make pgbench exit on SIGINT more reliably

From: "Tristan Partin" <tristan(at)neon(dot)tech>
To: "Michael Paquier" <michael(at)paquier(dot)xyz>
Cc: "Yugo NAGATA" <nagata(at)sraoss(dot)co(dot)jp>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make pgbench exit on SIGINT more reliably
Date: 2023-07-11 14:58:11
Message-ID: CTZFJLBHY4DU.Z38WPJQ9MDUC@gonk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2023-07-11 15:00:41 Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes
Previous Message Tristan Partin 2023-07-11 14:46:43 Re: Use COPY for populating all pgbench tables