Re: BackgroundPsql's set_query_timer_restart() may not work

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: BackgroundPsql's set_query_timer_restart() may not work
Дата
Msg-id CALj2ACUfthqkmLwnH12u3OjErRGmZe6fEaDh6Riq11AdgHRQaw@mail.gmail.com
обсуждение исходный текст
Ответ на BackgroundPsql's set_query_timer_restart() may not work  (Masahiko Sawada <sawada.mshk@gmail.com>)
Ответы Re: BackgroundPsql's set_query_timer_restart() may not work  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Nov 28, 2023 at 6:48 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> 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:
>
> 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).

Right.

> 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.

It is added by commit 664d7575 and I agree that calling the function
without argument doesn't reset the query_timer_restart as intended.

A nitpick on the patch - how about honoring the passed-in parameter
with something like $self->{query_timer_restart} = 1 if !defined
$self->{query_timer_restart}; instead of just setting it to 1 (a value
other than undef) $self->{query_timer_restart} = 1;?

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



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

Предыдущее
От: Ilya Kosmodemiansky
Дата:
Сообщение: Re: PostgreSql: Canceled on conflict out to old pivot
Следующее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: [PATCH] pg_convert improvement