From: Daniel Gustafsson <daniel@yesql.se>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: psql: Add test for query canceling
Date: Tue, 24 Aug 2021 20:26:40 +0200
Message-ID: <49FB9125-8FAC-4B2A-B440-0A2CF16642CF@yesql.se> (raw)
In-Reply-To: <9f46b102-da4d-8312-54f0-1f3bc10b453c@enterprisedb.com>
References: <E1mH14Q-0002gh-HS@gemulon.postgresql.org>
<DD279DFC-DD59-458E-B469-75DC941765A4@yesql.se>
<alpine.DEB.2.22.394.2108201736060.498998@pseudo>
<5F16EBAA-30D3-4C0D-840C-C2FF2739E370@yesql.se>
<1957503.1629485278@sss.pgh.pa.us>
<9f46b102-da4d-8312-54f0-1f3bc10b453c@enterprisedb.com>
> On 24 Aug 2021, at 18:43, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>
> On 20.08.21 20:47, Tom Lane wrote:
>> I think you should drop the overly-cute bit with a SIGALRM handler,
>> and instead have a loop-with-delay around an attempt to read the
>> psql.pid file, after launching the psql run without an immediate
>> wait for termination. That gets rid of the first problem (though
>> you still want the loop to timeout eventually, it could wait up
>> to say 180 seconds, as we do elsewhere). Then the second problem
>> is easy to solve by making the pg_sleep delay twice as much.
>
> Here is a proposal. It waits separately for the pid file to appear and also checks for the sleep query to be registered by the backend, so it doesn't have any more dependencies on things happening "fast enough". And it's also faster in the normal case now. Thoughts?
From reading the patch, that looks like a really good combination of ideas for
this test. +1.
--
Daniel Gustafsson https://vmware.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: daniel@yesql.se, peter.eisentraut@enterprisedb.com, tgl@sss.pgh.pa.us, coelho@cri.ensmp.fr
Subject: Re: pgsql: psql: Add test for query canceling
In-Reply-To: <49FB9125-8FAC-4B2A-B440-0A2CF16642CF@yesql.se>
References: <E1mH14Q-0002gh-HS@gemulon.postgresql.org> <DD279DFC-DD59-458E-B469-75DC941765A4@yesql.se> <alpine.DEB.2.22.394.2108201736060.498998@pseudo> <5F16EBAA-30D3-4C0D-840C-C2FF2739E370@yesql.se> <1957503.1629485278@sss.pgh.pa.us> <9f46b102-da4d-8312-54f0-1f3bc10b453c@enterprisedb.com> <49FB9125-8FAC-4B2A-B440-0A2CF16642CF@yesql.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox