pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jacob Champion <jchampion@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: oauth: Track total call count during a client flow
Date: Fri, 08 Aug 2025 16:07:27 +0000
Message-ID: <E1ukPct-001PKI-12@gemulon.postgresql.org> (raw)

oauth: Track total call count during a client flow

Tracking down the bugs that led to the addition of comb_multiplexer()
and drain_timer_events() was difficult, because an inefficient flow is
not visibly different from one that is working properly. To help
maintainers notice when something has gone wrong, track the number of
calls into the flow as part of debug mode, and print the total when the
flow finishes.

A new test makes sure the total count is less than 100. (We expect
something on the order of 10.) This isn't foolproof, but it is able to
catch several regressions in the logic of the prior two commits, and
future work to add TLS support to the oauth_validator test server should
strengthen it as well.

Backpatch-through: 18
Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/41aac1483a6ce61c0a721c590caaaaaf838eae47

Modified Files
--------------
src/interfaces/libpq-oauth/oauth-curl.c          | 22 +++++++++++++++++
src/test/modules/oauth_validator/t/001_server.pl | 31 +++++++++++++++++++++++-
2 files changed, 52 insertions(+), 1 deletion(-)



view thread (2+ messages)

Message-ID: <E1ukPct-001PKI-12@gemulon.postgresql.org>
Permalink:  ../E1ukPct-001PKI-12@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ukPct-001PKI-12@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: jchampion@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: oauth: Track total call count during a client flow
  In-Reply-To: <E1ukPct-001PKI-12@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox