Re: pgsql: psql: Add test for query canceling

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: psql: Add test for query canceling
Дата
Msg-id 350197.1629824350@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: psql: Add test for query canceling  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: pgsql: psql: Add test for query canceling  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-committers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> 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?

That looks pretty solid to me, and I can confirm that it passes
on wrasse's host.  The only nit I can find to pick is that this:

+    usleep(10_000) until -s "$tempdir/psql.pid" or ($count++ > 180 * 100 and die 'pid file did not appear');

basically assumes that psql.pid will be written atomically.
It'd be marginally safer to wait till psql.pid can be seen to
contain a newline.  I don't think that would be too hard to do,
if you put the slurp_file call inside the wait loop and inspect
its result.

            regards, tom lane



В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pgsql: psql: Add test for query canceling
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: pgsql: psql: Add test for query canceling