BackgroundPsql's set_query_timer_restart() may not work
От | Masahiko Sawada |
---|---|
Тема | BackgroundPsql's set_query_timer_restart() may not work |
Дата | |
Msg-id | CAD21AoA0B6VKe_5A9nZi8i5umwSN-zJJuPVNht9DaOZ9SJumMA@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: BackgroundPsql's set_query_timer_restart() may not work
|
Список | pgsql-hackers |
Hi, While adding some TAP tests, I realized that set_query_timer_restart() in BackgroundPsql may not work. Specifically, it seems not to work unless we pass an argument to the function. Here is the test script I used: use strict; use warnings; use PostgreSQL::Test::Cluster; use PostgreSQL::Test::Utils; use Test::More; my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; $PostgreSQL::Test::Utils::timeout_default = 5; my $bg_psql = $node->background_psql('postgres', on_error_stop => 1); $bg_psql->query_safe("select pg_sleep(3)"); $bg_psql->set_query_timer_restart(); $bg_psql->query_safe("select pg_sleep(3)"); $bg_psql->quit; is(1,1,"dummy"); $node->stop; done_testing(); If calling set_query_timer_restart() works properly, this test would pass since we reset the query timeout before executing the second pg_sleep(3). However, this test fail on my environment unless I use set_query_timer_restart(1) (i.e. passing something to the function). Currently authentication/t/001_password.pl is the sole user of set_query_timer_restart() function. I think we should define a value to query_timer_restart in set_query_timer_restart() function even if no argument is passed, like the patch attached, or we should change the caller to pass 1 to the function. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com
Вложения
В списке pgsql-hackers по дате отправления: