From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
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 11:52:38 -0400
Message-ID: <346518.1629820358@sss.pgh.pa.us> (raw)
In-Reply-To: <06B0EECD-BC76-4F57-BD49-ABEA17C41CC8@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>
<973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com>
<06B0EECD-BC76-4F57-BD49-ABEA17C41CC8@yesql.se>
Daniel Gustafsson <daniel@yesql.se> writes:
>> On 24 Aug 2021, at 15:40, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>> Thanks for looking into this. With your patch applied, tests 2, 3, and 4 fail. Do they pass for you?
> Thats odd, all tests pass for me. Did the logs give an indication as to what
> was failing?
I also tried the patch. It passes for me on my Linux box, although
it takes noticeably longer than before which doesn't seem great.
On wrasse's host, it fails. The Perl log shows:
ok 1 - PPID timer expired
ok 2 - psql was signaled
not ok 3 - query was canceled
# Failed test 'query was canceled'
# at t/020_cancel.pl line 50.
# 'postgres=# SELECT pg_sleep(15);
# Cancel request sent
# '
# doesn't match '(?-xism:canceling statement due to user request)'
ok 4 - Sleep query timer expired
The postmaster log shows that the cancel was received and acted on:
2021-08-24 17:39:39.021 CEST [2178] LOG: database system is ready to accept connections
2021-08-24 17:39:39.270 CEST [2187] 020_cancel.pl LOG: statement: SELECT pg_sleep(15);
2021-08-24 17:39:42.407 CEST [2187] 020_cancel.pl ERROR: canceling statement due to user request
2021-08-24 17:39:42.407 CEST [2187] 020_cancel.pl STATEMENT: SELECT pg_sleep(15);
2021-08-24 17:39:42.426 CEST [2178] LOG: received fast shutdown request
so I'm not sure why the error message didn't make its way back to the
client. Lack of pumping maybe? It's notable that there's not a lot
of time elapsed between the cancel and the shutdown, according to the
postmaster log, which says that we didn't wait for a timeout there.
Anyway, I'm not terribly thrilled with the patch as-presented, because
what I was hoping for was a test free of timing assumptions. This seems
to be worse not better by that light.
regards, tom lane
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: tgl@sss.pgh.pa.us, daniel@yesql.se, peter.eisentraut@enterprisedb.com, coelho@cri.ensmp.fr
Subject: Re: pgsql: psql: Add test for query canceling
In-Reply-To: <346518.1629820358@sss.pgh.pa.us>
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> <06B0EECD-BC76-4F57-BD49-ABEA17C41CC8@yesql.se> <346518.1629820358@sss.pgh.pa.us>
* 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