Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wVaAs-0023uN-1o for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jun 2026 19:25:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wVaAr-00E3Zc-1N for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jun 2026 19:25:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wVaAr-00E3ZT-04 for pgsql-hackers@lists.postgresql.org; Fri, 05 Jun 2026 19:25:45 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wVaAn-00000001Hps-3Y8F for pgsql-hackers@postgresql.org; Fri, 05 Jun 2026 19:25:44 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 71A36608411 for ; Fri, 05 Jun 2026 21:25:38 +0200 (CEST) Received: from s981.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id 5C45661FC44; Fri, 05 Jun 2026 21:25:38 +0200 (CEST) Received: from localhost (unknown [172.22.191.5]) by s981.loopia.se (Postfix) with ESMTP id 5A27322B173E; Fri, 05 Jun 2026 21:25:38 +0200 (CEST) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s470.loopia.se (amavis); dkim=pass (2048-bit key) header.d=yesql.se Received: from s981.loopia.se ([172.22.191.5]) by localhost (s470.loopia.se [172.22.190.34]) (amavis, port 10024) with LMTP id BRkcj2Mfhu57; Fri, 5 Jun 2026 21:25:38 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.236 Received: from smtpclient.apple (customer-89-255-232-236.stosn.net [89.255.232.236]) (Authenticated sender: daniel@yesql.se) by s981.loopia.se (Postfix) with ESMTPSA id BFD4F22B1767; Fri, 05 Jun 2026 21:25:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1780687537; bh=aaihzqqJhPIMCD8B4GqDTBdhfhm/OP15g3Qy/eJfY8Y=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Wmdsl5sQiOeV0sOmreJZSEc2QSguQyw7P//7griLLdsRBHhz7OmdL9zAkqySa8yyX jfdjoOByc4lc9eJgGTvhW9YlKIanjtiTVvZqkaFpGh4NDKAV+nbTWzS462ToVON6ex xFM6545+iYVXEbi7QZ2RaPBtrB5OlKUIFY7xFnp11f3/gw5nNkObORbigKcy1BvziM l4XjjPVG2egYSr+uN/P5JL0S8UUz3o0wm0g86hrGqmSW0TVD5C1NaEQyjddkuJPBjk WIaSTXetOXj+W1ZsQNhKzYNw5JOhqYCr1XnauEb0gNmy2PVVCrcHA8CXG7Ft5w+2PN S1jVWxAcnZrFw== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.12\)) Subject: Re: oauth integer overflow From: Daniel Gustafsson In-Reply-To: Date: Fri, 5 Jun 2026 21:25:27 +0200 Cc: Andres Freund , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <52EEC73C-5887-43F0-848B-DF515DCDFBBF@yesql.se> To: Jacob Champion X-Mailer: Apple Mail (2.3776.700.51.11.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 5 Jun 2026, at 21:06, Jacob Champion = wrote: >=20 > On Thu, Apr 23, 2026 at 11:31=E2=80=AFAM Jacob Champion > wrote: >> Attached. The static_assert for the millisecond calculation is the >> only part I don't really like, but doing an overflow check on a >> calculation that can't overflow int64 is even more verbose/wasteful. >=20 > I was preparing to commit this for beta1 last week, and I realized > that I've changed my tune. With all the recent backports of overflow > checks, I think I need to be reaching for them by default, especially > in a non-performance-critical path. >=20 > v2 rewrites that part with a checked multiplication, which removes any > need for a static_assert complication. I agree with this approach, +1 on this version. > On Tue, Apr 28, 2026 at 4:18=E2=80=AFAM Daniel Gustafsson = wrote: >> When teading "disabled timer" I interpret that as a timer which is 0 = and has no >> interval (which might be due to not being a native speaker), but what = it >> actually describes is an interval which (in practice) never ends. = Perhaps it >> could be phrased more like "for most people is going to be equivalent = to a >> never ending interval". >=20 > This has been completely rewritten now; see what you think. LGTM. -- Daniel Gustafsson