Re: [PoC] Federated Authn/z with OAUTHBEARER - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [PoC] Federated Authn/z with OAUTHBEARER
Date
Msg-id CA+hUKGKmyShTB_rDmn3Zy-+9-iNFeMJZnS9iMMHFtUAohjK=Ow@mail.gmail.com
Whole thread Raw
In response to Re: [PoC] Federated Authn/z with OAUTHBEARER  (Jacob Champion <jacob.champion@enterprisedb.com>)
Responses Re: [PoC] Federated Authn/z with OAUTHBEARER
List pgsql-hackers
On Fri, Mar 7, 2025 at 9:57 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> 2) macOS's EVFILT_TIMER implementation seems to be different from the
> other BSDs. On Mac, when you re-add a timer to a kqueue, any existing
> timer-fired events for it are not cleared out and the kqueue might
> remain readable. This breaks a postcondition of our set_timer()
> function, which is that new timeouts are supposed to completely
> replace previous timeouts.

I don't see that behaviour on my Mac with a simple program, and that
seems like it couldn't possibly be intended.  Hmm...  <browses source
code painfully> I wonder if this atomic generation scheme has a hole
in it, under concurrency...


https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/kern/kern_event.c#L1661

The code on the other OSes just dequeues it when reprogramming the
timer, which involves a lock and no doubt a few more cycles, and is
clearly not quite as exciting but ...



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Parallel heap vacuum
Next
From: Michael Paquier
Date:
Subject: Re: per backend WAL statistics