pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: constzl <const_sunny@126.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Is Backgroundworker.bgw_restart_time is defined in seconds?
Date: Thu, 26 Aug 2021 10:07:12 -0400
Message-ID: <648775.1629986832@sss.pgh.pa.us> (raw)
In-Reply-To: <5FD75B47-1F5F-470F-B349-0B54614A49A2@yesql.se>
References: <4baeccb.80f0.17b81651c54.Coremail.const_sunny@126.com>
	<5FD75B47-1F5F-470F-B349-0B54614A49A2@yesql.se>

Daniel Gustafsson <daniel@yesql.se> writes:
>> 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))

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

This may be intended to guard against integer overflows later (he guesses
without having read the code).

			regards, tom lane





view thread (4+ messages)

Message-ID: <648775.1629986832@sss.pgh.pa.us>
Permalink:  ../648775.1629986832@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/648775.1629986832@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, daniel@yesql.se, const_sunny@126.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Is Backgroundworker.bgw_restart_time is defined in seconds?
  In-Reply-To: <648775.1629986832@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox