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 1mHvDD-0004TF-BW for pgsql-committers@arkaria.postgresql.org; Sun, 22 Aug 2021 21:41:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mHvDC-0003NJ-3a for pgsql-committers@arkaria.postgresql.org; Sun, 22 Aug 2021 21:41:02 +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 1mHvDB-0003NB-U8 for pgsql-committers@lists.postgresql.org; Sun, 22 Aug 2021 21:41:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHvD9-0003HL-Jo for pgsql-committers@lists.postgresql.org; Sun, 22 Aug 2021 21:41:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 17MLea08042874; Sun, 22 Aug 2021 17:40:36 -0400 From: Tom Lane To: Peter Eisentraut cc: Daniel Gustafsson , Fabien COELHO , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: psql: Add test for query canceling In-reply-to: <1983764.1629499242@sss.pgh.pa.us> References: <5F16EBAA-30D3-4C0D-840C-C2FF2739E370@yesql.se> <1957503.1629485278@sss.pgh.pa.us> <1983764.1629499242@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 20 Aug 2021 18:40:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <42872.1629668436.1@sss.pgh.pa.us> Date: Sun, 22 Aug 2021 17:40:36 -0400 Message-ID: <42873.1629668436@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I see that c818c25f4 worked around sidewinder's issue with this test, but wrasse is still unhappy. I was able to duplicate the problem on wrasse's host, so I ran it under truss to see if I could see what's happening. What the truss log shows is that the Perl script successfully reads psql.pid and issues kill(SIGINT) to the correct process ... but very shortly thereafter it issues kill(SIGTERM) to the same process, so of course psql goes belly-up and doesn't complete the test. I suppose this is some undocumented interaction between IPC::Run and the SIGALRM signal handler. I stand by the recommendation that you need to not use a signal handler here. regards, tom lane