oauth: Track total call count during a client flow
Jacob Champion <jchampion@postgresql.org>
Author:
Jacob Champion <jchampion@postgresql.org>
Date: 2025-08-08T15:44:56Z
Releases:
19 (unreleased)
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
Files
| Path | Change | +/− |
|---|---|---|
| src/interfaces/libpq-oauth/oauth-curl.c | modified | +22 −0 |
| src/test/modules/oauth_validator/t/001_server.pl | modified | +30 −1 |
Discussion
- [PATCH] OAuth: fix performance bug with stuck multiplexer events 25 messages · 2025-06-26 → 2026-04-07