Re: [PATCH] OAuth: fix performance bug with stuck multiplexer events
Jacob Champion <jacob.champion@enterprisedb.com>
From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Daniel Gustafsson <daniel@yesql.se>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-08-07T18:11:02Z
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
On Wed, Aug 6, 2025 at 6:46 PM Thomas Munro <thomas.munro@gmail.com> wrote: > "Unlike epoll descriptors, kqueue descriptors only transition from > readable to unreadable when kevent() is called and finds nothing, > after removing level-triggered conditions that have gone away. We > therefore need a dummy kevent() call after operations might have been > performed on the monitored sockets or timer_fd. Any event returned is > ignored here, but it also remains queued (being level-triggered) and > leaves the descriptor readable. This is a no-op for epoll > descriptors." I really like this; I'm working it into the doc comment. > FWIW I re-read the kqueue paper's discussion of the goals of making > kqueue descriptors themselves monitorable/pollable, and it seems it > was mainly intended for hierarchies of kqueues, like your timer_fd, > with the specific aim of expressing priorities. It doesn't talk about > giving them to code that doesn't know it has a kqueue fd (the client) > and never calls kevent() and infers the events instead (libcurl). Interesting! It would be nice if they papered over this for us, but I guess that's water under the bridge. > s/signalled/signaled/ (= US spelling) in a couple of places. Ah. Will fix(?) or else lobby the dictionary companies. Thank you so much for the reviews! --Jacob