Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events
Jacob Champion <jacob.champion@enterprisedb.com>
From: Jacob Champion <jacob.champion@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Daniel Gustafsson <daniel@yesql.se>,
Thomas Munro <thomas.munro@gmail.com>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-07-28T20:52:42Z
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 →
-
oauth: Always link with -lm for floor()
- e76738e59790 18.0 landed
- 52ecd05aeef8 19 (unreleased) landed
-
oauth: Add unit tests for multiplexer handling
- 4e1e417330d4 19 (unreleased) landed
- 1443b6c0eaa2 19 (unreleased) landed
-
oauth: Ensure unused socket registrations are removed
- 16b0c48583a5 18.0 landed
- 3d9c03429a82 19 (unreleased) landed
-
oauth: Remove expired timers from the multiplexer
- e507e08acf63 18.0 landed
- 1749a12f0d20 19 (unreleased) landed
-
oauth: Remove stale events from the kqueue multiplexer
- ff181d1f876f 18.0 landed
- ff5b0824b3b0 19 (unreleased) landed
-
oauth: Track total call count during a client flow
- 41aac1483a6c 18.0 landed
- 3e311664e497 19 (unreleased) landed
Attachments
- since-v1.diff.txt (text/plain)
- v2-0001-oauth-Remove-stale-events-from-the-kqueue-multipl.patch (application/octet-stream) patch v2-0001
- v2-0002-oauth-Remove-expired-timers-from-the-multiplexer.patch (application/octet-stream) patch v2-0002
- v2-0003-oauth-Track-total-call-count-during-a-client-flow.patch (application/octet-stream) patch v2-0003
- v2-0004-oauth-Add-unit-tests-for-multiplexer-handling.patch (application/octet-stream) patch v2-0004
Hi all, 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. Thanks, --Jacob