Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIWga-0004ZT-Rx for pgsql-committers@arkaria.postgresql.org; Tue, 24 Aug 2021 13:41:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mIWgZ-0001kq-S2 for pgsql-committers@arkaria.postgresql.org; Tue, 24 Aug 2021 13:41:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIWgZ-0001kh-MC for pgsql-committers@lists.postgresql.org; Tue, 24 Aug 2021 13:41:51 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIWgU-0008A3-L5 for pgsql-committers@lists.postgresql.org; Tue, 24 Aug 2021 13:41:51 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 65FC32E9A5F3 for ; Tue, 24 Aug 2021 15:41:45 +0200 (CEST) Received: from s630.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 558E52E2C772; Tue, 24 Aug 2021 15:41:45 +0200 (CEST) Received: from s475.loopia.se (unknown [172.22.191.5]) by s630.loopia.se (Postfix) with ESMTP id 32D7513B9499; Tue, 24 Aug 2021 15:41:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s499.loopia.se ([172.22.191.5]) by s475.loopia.se (s475.loopia.se [172.22.190.15]) (amavisd-new, port 10024) with LMTP id q8FEGdHK74ZK; Tue, 24 Aug 2021 15:41:44 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from [192.168.72.144] (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s499.loopia.se (Postfix) with ESMTPSA id BC3ED1CE632D; Tue, 24 Aug 2021 15:41:44 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: pgsql: psql: Add test for query canceling From: Daniel Gustafsson In-Reply-To: <973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com> Date: Tue, 24 Aug 2021 15:41:44 +0200 Cc: Tom Lane , Fabien COELHO , pgsql-committers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <06B0EECD-BC76-4F57-BD49-ABEA17C41CC8@yesql.se> References: <5F16EBAA-30D3-4C0D-840C-C2FF2739E370@yesql.se> <1957503.1629485278@sss.pgh.pa.us> <1983764.1629499242@sss.pgh.pa.us> <973f7e4c-bf02-86f3-9909-988046b9362e@enterprisedb.com> To: Peter Eisentraut X-Mailer: Apple Mail (2.3608.120.23.2.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 24 Aug 2021, at 15:40, Peter Eisentraut = wrote: >=20 > On 23.08.21 13:12, Daniel Gustafsson wrote: >>> On 21 Aug 2021, at 00:40, Tom Lane wrote: >>>=20 >>> Daniel Gustafsson writes: >>>> On 20 Aug 2021, at 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. >>>=20 >>>> This could perhaps be done with a PostgresNode::interactive_psql >>>> session? >>>=20 >>> 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=E2=80=99t 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. >=20 > 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? -- Daniel Gustafsson https://vmware.com/