Re: Is Backgroundworker.bgw_restart_time is defined in seconds?

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: Is Backgroundworker.bgw_restart_time is defined in seconds?
Дата
Msg-id 5FD75B47-1F5F-470F-B349-0B54614A49A2@yesql.se
обсуждение исходный текст
Ответ на Is Backgroundworker.bgw_restart_time is defined in seconds?  (constzl <const_sunny@126.com>)
Ответы Re:Re: Is Backgroundworker.bgw_restart_time is defined in seconds?  (constzl <const_sunny@126.com>)
Re: Is Backgroundworker.bgw_restart_time is defined in seconds?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> On 26 Aug 2021, at 09:38, constzl <const_sunny@126.com> wrote:

>     if ((worker->bgw_restart_time < 0 &&
>          worker->bgw_restart_time != BGW_NEVER_RESTART) ||
>         (worker->bgw_restart_time > USECS_PER_DAY / 1000))
>
> > The Backgroundworker.bgw_restart_time is defined in seconds,
> > so should it be "USECS_PER_DAY / 1000,000" here instead of "USECS_PER_DAY / 1000"?
> > Or am I getting it wrong?

bgw_restart_time is defined as "It can be any positive value” in the docs, see:

    https://www.postgresql.org/docs/current/bgworker.html

My reading of the above code is that is tries to catch nonsensical values, not
to cap it to enforce restarts within a 24h period.

--
Daniel Gustafsson        https://vmware.com/




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

Предыдущее
От: constzl
Дата:
Сообщение: Is Backgroundworker.bgw_restart_time is defined in seconds?
Следующее
От: constzl
Дата:
Сообщение: Re:Re: Is Backgroundworker.bgw_restart_time is defined in seconds?