Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Daniel Gustafsson <daniel@yesql.se>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-08-04T14:53:18Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. oauth: Always link with -lm for floor()

  2. oauth: Add unit tests for multiplexer handling

  3. oauth: Ensure unused socket registrations are removed

  4. oauth: Remove expired timers from the multiplexer

  5. oauth: Remove stale events from the kqueue multiplexer

  6. oauth: Track total call count during a client flow

On Tue, Jul 29, 2025 at 8:52 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> On Thu, Jun 26, 2025 at 4:33 PM Jacob Champion
> <jacob.champion@enterprisedb.com> wrote:
> > My plan, if this code seems reasonable, is to backport 0001-0003, but
> > keep the larger 0004 on HEAD only until it has proven to be stable.
> > It's a big new suite and I want to make sure it's not flapping on some
> > buildfarm animal. Eventually I'll backport that too.
>
> Any thoughts on the approach? Too big/too scary/too BSD-specific?
>
> A small bit of self-review: a comment I wrote in the tests suggested
> that the choice of readable/writable events was up to the multiplexer
> implementation, but it *must* choose readable, due to the hardcoded
> use of PGRES_POLLING_READING throughout the current code. Updated in
> v2.

[FYI, I'm looking into this and planning to post a review in 1-2 days...]