Re: pgsql: psql: Add test for query canceling - Mailing list pgsql-committers

From Peter Eisentraut
Subject Re: pgsql: psql: Add test for query canceling
Date
Msg-id 9f46b102-da4d-8312-54f0-1f3bc10b453c@enterprisedb.com
Whole thread Raw
In response to Re: pgsql: psql: Add test for query canceling  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: psql: Add test for query canceling  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pgsql: psql: Add test for query canceling  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-committers
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?

Attachment

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: psql: Add test for query canceling
Next
From: Tom Lane
Date:
Subject: Re: pgsql: psql: Add test for query canceling