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

Jacob Champion <jacob.champion@enterprisedb.com>

From: Jacob Champion <jacob.champion@enterprisedb.com>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: Thomas Munro <thomas.munro@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Daniel Gustafsson <daniel@yesql.se>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-08-08T20:52:09Z
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 Fri, Aug 8, 2025 at 1:07 PM Dagfinn Ilmari Mannsåker
<ilmari@ilmari.org> wrote:
>     $ perl -MJSON::PP=encode_json -E 'say encode_json([1, 2, 3])'
>     [1,2,3]
>
>     $ perl -MJSON::PP=encode_json -E 'say encode_json([1 => (2, 3)])'
>     [1,2,3]

I swear, this language.

But:

    $ perl -MJSON::PP=encode_json -E 'say encode_json(1,2)'
    Too many arguments for JSON::PP::encode_json at -e line 1, near "2)
    $ perl -MJSON::PP=encode_json -E 'say encode_json((1,2))'
    2

So what's going on there? (Google is not very helpful for these sorts
of Perl problems; I don't even know how to describe this.)

I had to revert the test for unrelated reasons [1], so if this is
indeed guaranteed to be safe then I can make the change in my next
attempt.

Thanks!
--Jacob

[1] https://postgr.es/m/CAOYmi%2BnCkoh3zB%2BGkZad44%3DFNskwUg6F1kmuxqQZzng7Zgj5tw%40mail.gmail.com