BUG/MINOR: mux-h2: prevent past scheduling with idle connections
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 9 Apr 2025 12:26:54 +0000 (14:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Apr 2025 09:11:05 +0000 (11:11 +0200)
commit8a7c0a761d950aa536f49045a35e65350eebb948
treef861eff1f871f8719e6f253ae30d0e17dd2b1cdb
parent3a592c2eae4cdb23fcd0feb968df84ed3be34022
BUG/MINOR: mux-h2: prevent past scheduling with idle connections

While reviewing HTTP/2 MUX timeout, it seems there is a possibility that
MUX task is requeued via h2c_update_timeout() with an already expired
date. This can happens with idle connections on two cases :
* first with shut timeout, as timer is not refreshed if already set
* second with http-request and keep-alive timers, which are based on
  idle_start

Queuing an already expired task is an undefined behavior. Fix this by
using task_wakeup() instead of task_queue() at the end of
h2c_update_timeout() if such case occurs.

This should be backported up to 2.6.

(cherry picked from commit 3ebdd3ae509236af1f19d80cab98b385a751426b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 516121499c8edafb67a861bcd1bf41b3cc6f12d2)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/mux_h2.c