pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Daniel Gustafsson <daniel@yesql.se>
To: 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 15:40:02 +0200
Message-ID: <973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com> (raw)
In-Reply-To: <F8E93259-D461-48DB-B572-D5FCE66CBC6F@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>
	<E92FAE70-66D7-4826-88D0-379004D385C7@yesql.se>
	<1983764.1629499242@sss.pgh.pa.us>
	<F8E93259-D461-48DB-B572-D5FCE66CBC6F@yesql.se>

On 23.08.21 13:12, Daniel Gustafsson wrote:
>> On 21 Aug 2021, at 00:40, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> Daniel Gustafsson <daniel@yesql.se> writes:
>>> On 20 Aug 2021, at 20:47, Tom Lane <tgl@sss.pgh.pa.us> 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.
>>
>>> This could perhaps be done with a PostgresNode::interactive_psql
>>> session?
>>
>> Yeah, we do have that infrastructure available in the
>> 010_tab_completion.pl test.
> 
> In order to satisfy my own curiosity I decided to take a stab at this which
> turned into the attached.  I wasn’t able to reliably know that the pg_sleep
> query had started except letting the timer expire, but that may very well be
> the rust on my Perl skills showing.

Thanks for looking into this.  With your patch applied, tests 2, 3, and 
4 fail.  Do they pass for you?





view thread (20+ messages)  latest in thread

Message-ID: <973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com>
Permalink:  ../973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com/
Also on:    postgresql.org/message-id/973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com

 · 

reply

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: peter.eisentraut@enterprisedb.com, daniel@yesql.se, tgl@sss.pgh.pa.us, coelho@cri.ensmp.fr
  Subject: Re: pgsql: psql: Add test for query canceling
  In-Reply-To: <973f7e4c-bf02-86f3-9909-988046b9362e@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> <E92FAE70-66D7-4826-88D0-379004D385C7@yesql.se> <1983764.1629499242@sss.pgh.pa.us> <F8E93259-D461-48DB-B572-D5FCE66CBC6F@yesql.se> <973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com>

* 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