pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: oauth: Remove expired timers from the multiplexer
2+ messages / 1 participants
[nested] [flat]

* pgsql: oauth: Remove expired timers from the multiplexer
@ 2025-08-08 16:07 Jacob Champion <jchampion@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Jacob Champion @ 2025-08-08 16:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

oauth: Remove expired timers from the multiplexer

In a case similar to the previous commit, an expired timer can remain
permanently readable if Curl does not remove the timeout itself. Since
that removal isn't guaranteed to happen in real-world situations,
implement drain_timer_events() to reset the timer before calling into
drive_request().

Moving to drain_timer_events() happens to fix a logic bug in the
previous caller of timer_expired(), which treated an error condition as
if the timer were expired instead of bailing out.

The previous implementation of timer_expired() gave differing results
for epoll and kqueue if the timer was reset. (For epoll, a reset timer
was considered to be expired, and for kqueue it was not.) This didn't
previously cause problems, since timer_expired() was only called while
the timer was known to be set, but both implementations now use the
kqueue logic.

Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Backpatch-through: 18
Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1749a12f0d2005ba23236089f0a32e6c6c1533f0

Modified Files
--------------
src/interfaces/libpq-oauth/oauth-curl.c | 108 ++++++++++++++++++++------------
1 file changed, 68 insertions(+), 40 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: oauth: Remove expired timers from the multiplexer
@ 2025-08-08 16:07 Jacob Champion <jchampion@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Jacob Champion @ 2025-08-08 16:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

oauth: Remove expired timers from the multiplexer

In a case similar to the previous commit, an expired timer can remain
permanently readable if Curl does not remove the timeout itself. Since
that removal isn't guaranteed to happen in real-world situations,
implement drain_timer_events() to reset the timer before calling into
drive_request().

Moving to drain_timer_events() happens to fix a logic bug in the
previous caller of timer_expired(), which treated an error condition as
if the timer were expired instead of bailing out.

The previous implementation of timer_expired() gave differing results
for epoll and kqueue if the timer was reset. (For epoll, a reset timer
was considered to be expired, and for kqueue it was not.) This didn't
previously cause problems, since timer_expired() was only called while
the timer was known to be set, but both implementations now use the
kqueue logic.

Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
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/e507e08acf63ffa6777424f53cec24e6a1363571

Modified Files
--------------
src/interfaces/libpq-oauth/oauth-curl.c | 108 ++++++++++++++++++++------------
1 file changed, 68 insertions(+), 40 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-08-08 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-08-08 16:07 pgsql: oauth: Remove expired timers from the multiplexer Jacob Champion <jchampion@postgresql.org>
2025-08-08 16:07 pgsql: oauth: Remove expired timers from the multiplexer Jacob Champion <jchampion@postgresql.org>

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