Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJG2R-0005m3-Uc for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Aug 2021 14:07:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJG2P-0007MI-S5 for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Aug 2021 14:07:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJG2P-0007MA-Lk for pgsql-bugs@lists.postgresql.org; Thu, 26 Aug 2021 14:07:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJG2N-0001hu-L1 for pgsql-bugs@lists.postgresql.org; Thu, 26 Aug 2021 14:07:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 17QE7CZY648776; Thu, 26 Aug 2021 10:07:12 -0400 From: Tom Lane To: Daniel Gustafsson cc: constzl , pgsql-bugs@lists.postgresql.org Subject: Re: Is Backgroundworker.bgw_restart_time is defined in seconds? 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> Comments: In-reply-to Daniel Gustafsson message dated "Thu, 26 Aug 2021 10:09:36 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <648774.1629986832.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 26 Aug 2021 10:07:12 -0400 Message-ID: <648775.1629986832@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: >> On 26 Aug 2021, at 09:38, constzl wrote: >> if ((worker->bgw_restart_time < 0 && >> worker->bgw_restart_time !=3D BGW_NEVER_RESTART) || >> (worker->bgw_restart_time > USECS_PER_DAY / 1000)) > My reading of the above code is that is tries to catch nonsensical value= s, 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