Re: [PoC] Federated Authn/z with OAUTHBEARER

From: Andres Freund <andres(at)anarazel(dot)de>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Antonin Houska <ah(at)cybertec(dot)at>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Date: 2025-02-24 20:30:49
Message-ID: uqzksikuuprgcu4mrpqdu65s7loh52pghdaq5rkzdruhgy4wse@4ojpvnsfumpc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-02-24 09:39:52 -0800, Jacob Champion wrote:
> On Fri, Feb 21, 2025 at 9:19 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > And, probably worse, isn't relying on getting EINTR rather racy, due to the
> > chance of the signal arriving between CHECK_FOR_INTERRUPTS() and the blocking
> > system call?
>
> That is worse, and to be honest I hadn't ever thought about that race
> condition before your email. So wait... how do people actually rely on
> EINTR in production-grade client software? pselect/ppoll exist,
> clearly, but they're used so rarely IME. (Have we all just been
> subconsciously trained to mash Ctrl-C until the program finally stops?
> I'm honestly kind of horrified by this revelation.)

If you need to handle the race it you need to combine it with something
additional, e.g. the so called "self pipe trick". Which e.g. the latch / wait
event set code does.

> > Is it a good idea to support that? We e.g. rely on libpq connections made by
> > the backend to be interruptible. Admittedly that's, I think, already not
> > bulletproof, due to libpq's DNS lookups going through libc if connection
> > string contains a name that needs to be looked up, but this seems to make that
> > a bit worse?
>
> A bit. The same for Kerberos, IIRC. Is the current configure warning
> not strong enough to imply that the packager is on shaky ground?

I don't think it's strong enough.

> (I patterned that off of the LDAP crash warning, which seemed much worse to
> me. :D)

I don't think that's a comparable case, because there were in-production uses
of PG+ldap that (kind of) worked. Whereas we start on a green field here.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-24 20:30:59 Re: pgbench client-side performance issue on large scripts
Previous Message Jeff Davis 2025-02-24 20:20:41 Re: Statistics Import and Export